Closed MrStahlfelge closed 1 year ago
BigDecimal does not respect a set scale when printing output with toPlainString, while JVM implementation does.
To Reproduce assertEquals("1.000000", 1000000.toBigDecimal().moveDecimalPoint(-6).scale(6).toPlainString())
Succeeds on JVM, fails with this library ("1" returned instead)
Expected behavior Format with set scale.
Problem caused by placeADotInStringExpanded method always truncating trailing zeros.
placeADotInStringExpanded
Thanks for reporting, you are right it should behave as the JVM counterpart.
BigDecimal does not respect a set scale when printing output with toPlainString, while JVM implementation does.
To Reproduce assertEquals("1.000000", 1000000.toBigDecimal().moveDecimalPoint(-6).scale(6).toPlainString())
Succeeds on JVM, fails with this library ("1" returned instead)
Expected behavior Format with set scale.
Problem caused by
placeADotInStringExpanded
method always truncating trailing zeros.