Skip to content

Commit

Permalink
Better detect integer in the toml renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenamar-db committed Dec 10, 2024
1 parent c027788 commit 9e6500b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sjsonnet/src/sjsonnet/TomlRenderer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class TomlRenderer(out: StringWriter = new java.io.StringWriter(), cumulatedInde
case Double.PositiveInfinity => out.write("inf")
case Double.NegativeInfinity => out.write("-inf")
case d if java.lang.Double.isNaN(d) => out.write("nan")
case d if d.toLong == d => out.write(java.lang.Long.toString(d.toLong))
case d if math.round(d).toDouble == d => out.write(java.lang.Long.toString(d.toLong))
case d => out.write(java.lang.Double.toString(d))
}
flush
Expand Down

0 comments on commit 9e6500b

Please sign in to comment.