cyanskies / another-toml-cpp

MIT License
1 stars 0 forks source link

Truncate excess millisecond precision #8

Closed cyanskies closed 4 months ago

cyanskies commented 1 year ago

Currently excess precision is passed though the standard double-to-string and vice versa conversion functions. This usage needs to be checked to ensure the data is being truncated rather than rounded.

This applies to both parsing and writing.

cyanskies commented 4 months ago

Note that this only applies to the fractional seconds in a datetime, not ordinary floats.

cyanskies commented 4 months ago

The relevant code is located here: https://github.com/cyanskies/another-toml-cpp/blob/1e88811d5a0b9110026e64d0949c8cfd4b791812/source/string_util.cpp#L319