Skip to content

Commit d3d5823

Browse files
Fix build
1 parent a03aa87 commit d3d5823

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

ubjson-derivation/src/main/scala/hearth/kindlings/ubjsonderivation/UBJsonWriter.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff 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)

xml-derivation/src/test/scala/hearth/kindlings/xmlderivation/KindlingsXmlDecoderSpec.scala renamed to xml-derivation/src/test/scalajvm/hearth/kindlings/xmlderivation/KindlingsXmlDecoderSpec.scala

File renamed without changes.

0 commit comments

Comments
 (0)