File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
ubjson-derivation/src/main/scala/hearth/kindlings/ubjsonderivation
xml-derivation/src/test/scalajvm/hearth/kindlings/xmlderivation Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,11 @@ final class UBJsonWriter(private val out: OutputStream) {
132132 }
133133
134134 def writeBigDecimal (v : BigDecimal ): Unit = {
135- val str = v.underlying().toPlainString
135+ // Use toString instead of toPlainString — Scala Native's toPlainString
136+ // has a bug that zeroes out the integer part (e.g. "12.34" → "00.34").
137+ // toString may produce scientific notation (e.g. "1E+10") but BigDecimal(str)
138+ // can parse it back correctly.
139+ val str = v.toString
136140 val bytes = str.getBytes(StandardCharsets .UTF_8 )
137141 writeByte('H' )
138142 writeLength(bytes.length)
File renamed without changes.
You can’t perform that action at this time.
0 commit comments