This (renamed) fork adds the type specific defaults from @tbreloff’s PR:
renames fmt to pyfmt (Python Format) and sprintf1 to cfmt (C format) (fmt is use for type specific output with defaults from Tom’s PR).
I use this package for all the formatted printing support in my package:
Note: I have also submitted a PR https://github.com/JuliaIO/Formatting.jl/pull/30 to make the original Formatting package work on v0.6, if anybody with commit privileges in the JuliaIO org sees this, it’s passing all of the tests and is ready to merge.
That’s not a bug with format, the issue is binary floating point only has 53 bits for the value (really 52, but there’s actually an assumed leading 1 bit for all except subnormal numbers). The rest of the bits are for the sign bit and a biased exponent.
julia> x = 111222333444555666.01