You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Toml (the spec) supports only binary64/double/f64 representable numbers. There's overlap between the numbers representable in binary64 and decimal, but both can express numbers that the other can't. This makes for a particularly challenging situation to implement, unless we were to use a string literal or something (which seems bad). I prototyped a solution that worked until the unit tests started testing decimal.MaxValue. It can't roundtrip, unfortunately.
lilith
added a commit
to lilith/Tomlyn
that referenced
this issue
Feb 1, 2024
Here's my branch that explored this: https://github.com/lilith/Tomlyn/tree/decimal-support
Honestly the safest approach might be to explicitly document decimal is not supported, and also throw an exception on use.
Reading numbers into a decimal type won't work if the double is too small or large.
There is no toString method in TomlFormatHelper defined for the decimal floating point type. Decimal numbers are then simply missing from the output.
Reading numbers into a decimal type works.
Cheers,
Torsten
The text was updated successfully, but these errors were encountered: