posit-dev / great-tables

Make awesome display tables using Python.
https://posit-dev.github.io/great-tables/
MIT License
1.43k stars 48 forks source link

Add ability to format as accounting values (in `fmt_*()` methods where it makes sense) #278

Open rich-iannone opened 2 months ago

rich-iannone commented 2 months ago

We currently don't have the ability to format numeric values as accounting-type values (i.e., handling of negative values different than using the minus sign). This should ideally work inside:

As for how it would look, this is a good start:

accounting_values
Julian-J-S commented 2 months ago

Great Idea! 😃

Not sure if this is just to show the format but the "percent" value looks wrong 😄 . Most programms (like excel, powerbi, ...) multiply by 100 and not divide by 10 😮 .

For example you perform a calculation resulting in 0.15 and formatted as percent yields 15% (1 = 100%)

rich-iannone commented 2 months ago

I rescaled the number before applying the percent formatting (to put it in a better range).