Convert a float to a string. This produces pretty good results
for the most part, though one should use David Gay's dtoa package
for best accuracy.
Note that the approach first normalizes a base10 mantissa, then
pulls digits from the left side whilst emitting them (rightward)
to the output.
The e parameter controls the number of exponent places emitted,
and can thus control where the output switches to the scientific
notation. For example, setting e=2 for 0.01 or 10.0 would result
in normal output. Whereas setting e=1 would result in both those
values being rendered in scientific notation instead. Setting e
to 0 forces that notation on for everything.
TODO: this should be replaced, as it is not sufficiently accurate
Convert a float to a string. This produces pretty good results for the most part, though one should use David Gay's dtoa package for best accuracy.
Note that the approach first normalizes a base10 mantissa, then pulls digits from the left side whilst emitting them (rightward) to the output.
The e parameter controls the number of exponent places emitted, and can thus control where the output switches to the scientific notation. For example, setting e=2 for 0.01 or 10.0 would result in normal output. Whereas setting e=1 would result in both those values being rendered in scientific notation instead. Setting e to 0 forces that notation on for everything.
TODO: this should be replaced, as it is not sufficiently accurate