Change %g format specifier to %.*g with full double precision
Sometimes we need more decimal digits of precision when converting double values to ASCII than what is afforded by %g, so use %.*g with std::numeric_limits::max_digits10 to specify the precision.
Fixes #17360.
Edited by Cory Quammen