Closed 7keo closed 2 years ago
Cool, thanks, this is very interesting! Would never think about this myself, but it seems to be a pretty standard way to align numbers: https://ux.stackexchange.com/questions/13795/is-there-a-standard-to-left-justify-text-and-right-justify-numeric-values I will plan to add this feature, maybe this should even be the default behavior, IDK. The aligning algorithm makes 2 passes anyway - the first pass to determine max string width, and the second pass to align. So during the first pass, we can check if the current column is an integer or float which should be pretty straightforward with a simple regex.
There will be a ton of corner cases though: aligning percent values, scientific notation, columns with NaNs, etc. But probably even the most basic algorithm will cover the majority of cases.
I just published version 2.3.0 which does numeric alignment by default. The following corner cases are handled:
Issue:
Currently numbers align like this:
(Default: Align numbers to the left)
Desired:
Option: Align numbers to the right
1.05 103 52.1
Option: Align numbers to the decimal point
14 1.05 103 52.1
Thank you.
PS: This extension is great!