ronisbr / PrettyTables.jl

Print data in formatted tables.
MIT License
404 stars 38 forks source link

thousand separator #239

Closed kafisatz closed 7 months ago

kafisatz commented 7 months ago

All, in the past I used "%'d" (with PrettyTables.jl) to show integers with a thousand separator. However, this is not working anymore, see below.

Any idea how to fix this?

julia> v=10000000000;PrettyTables.sprintf1("%d",v)
"10000000000"

julia> v=10000000000;PrettyTables.sprintf1("%'d",v)
ERROR: InvalidFormatStringError: ''' is not a valid type specifier
    "%'d"
     -^

Stacktrace:
 [1] Printf.Format(f::String)
   @ Printf C:\Users\bernhard\.julia\juliaup\julia-1.10.1+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Printf\src\Printf.jl:237
 [2] sprintf1(fmt::String, x::Int64)
   @ PrettyTables C:\Users\bernhard\.julia\packages\PrettyTables\E8rPJ\src\helpers.jl:150
 [3] top-level scope
   @ REPL[36]:1
ronisbr commented 7 months ago

Hi @kafisatz !

Unfortunately it is not possible anymore because we removed the dependency on Formatting.jl, see https://github.com/ronisbr/PrettyTables.jl/issues/210

The only way to accomplish it is to use some external package and a formatter.

kafisatz commented 7 months ago

Ok. Thanks.