Formatting.jl
Formatting.jl copied to clipboard
skip decimal point when 0 decimal digits are requested
When no decimal digits are requested, no decimal digits are formatted, but the decimal point is still included. This is different from printf in C and from format in Python, which omit the decimal point in this case.
Example in Python:
"{:.0f}".format(123.4)
## result: '123'
Example in Julia
using Formatting
fmt(".0f", 123.4)
## result: "123."
format("{:.0f}", 123.4)
## result: "123."
Would it be possible to change this behaviour and make it the same as C printf() and Python format()?
I second this request! This discrepancy has led to nasty bugs in a workflow of mine that combines Python and Julia scripts.