Closed machow closed 1 month ago
Similarly this fails:
import polars as pl
from great_tables import GT
df = pl.DataFrame({"x": [[1, 2], [-704, 3]]})
GT(df).fmt_nanoplot("x", plot_type="bar")
~Because -704 has its minus sign converted (in the line above) from a hyphen (computer speak for minus) to the minus sign character. ~
edit: wait, it's because it's formatted to '-,704'
here's a minimal reprex:
from great_tables.vals import fmt_number
fmt_number(-704, n_sigfig=3, decimals=1, compact=True) # ['-,704']
raises this error:
This is because 7045 is converted to
'7.04K'
, and then_remove_exponent()
is trying to convert that to a decimal.