DecimalFormatter
object DecimalFormatter
Number.prototype.toFixed, toExponential and toPrecision.
Upstream leans on java.math.BigDecimal for the exact decimal expansion of a double and its HALF_UP rounding. Common Kotlin has no BigDecimal, so this file expands the double by hand (every double is a finite decimal) and rounds the digit string itself. Same results, same shapes.