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
Currently we, when using the R specifier, attempt to format to 15 digits, roundtrip back, and if the value does not equal, we reformat to 17 digits and return that value. This has a number of issues, including that it is less performant and is not always correct. The simplest fix is to always roundtrip to 17 digits, but this has the undesired side-effect of returning less user-friendly strings for some numbers.
A more ideal fix would be to instead return the shortest roundtrippable string for a given value. There are several whitepapers on the subject and our current formatting algorithms (Dragon4 and Grisu3) both have sections in their whitepapers that cover this. This provides a good balance between being "correct" and returning "user-friendly" strings.