mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 20:31:51 +09:00
fix: bad number formatting on debug window
This commit is contained in:
@@ -103,7 +103,7 @@ class BasicDebugInfoWindow : UICanvas() {
|
||||
private fun Double?.toIntAndFrac(intLen: Int, fracLen: Int = 4): String =
|
||||
if (this == null) "null" else if (this.isNaN()) "NaN" else if (this.isInfinite()) "${if (this >= 0.0) '+' else '-'}Inf" else
|
||||
"${((if (this >= 0.0) "" else "-") + "${this.absoluteValue.toInt()}").padStart(intLen)}." +
|
||||
(10.0 pow fracLen.toDouble()).let { d -> (this.absoluteValue.times(d) % d).toInt().toString().padEnd(fracLen) }
|
||||
(10.0 pow fracLen.toDouble()).let { d -> (this.absoluteValue.times(d) % d).toInt().toString().padStart(fracLen, '0').padEnd(fracLen) }
|
||||
|
||||
private val gap = 14f
|
||||
|
||||
|
||||
Reference in New Issue
Block a user