GitHub - JuliaString/Format.jl: A Julia package to provide C and Python-like formatting support is now available (although it is unregistered currently).
It is based on GitHub - JuliaIO/Formatting.jl: A Julia package to provide Python-like formatting support, however it has dropped v0.4 support, and added support for v0.6-dev.
This (renamed) fork adds the type specific defaults from
05:15PM - 25 Jun 15 UTC
I don't intend this to be merged as-is, but I want to start a discussion as to w
pyfmt (Python Format) and
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:
Implement improved string literals with Swift-style syntax for interpolation, hex, & unicode characters, plus C & Python style formatting and Unicode, HTML, LaTeX, and Emoji entities - GitH...
Note: I have also submitted a PR
Fix issue #27, world age problem on v0.6 by ScottPJones · Pull Request #30 · JuliaIO/Formatting.jl · GitHub 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.
How can I submit an issue on your package? Probably cause I was looking at a branch. Posted
this issue on
Formatting.jl as well. [edited: now closed]
In any case:
julia> s = format(111222333444555666, commas=true, precision = 2 , stripzeros = true )
julia> s = format(111222333444555666.01, commas=true, precision = 2 , stripzeros = true )
"111,222,333,444,555,664" # <= shouldn't this be "111,222,333,444,555,666.01"?
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
Yap, sorry for the noise:
julia> 111222333444555666.01 == 111222333444555664