FWIW: the complexity of this is starting to call for a custom template function.
I have somewhere a python script that scans the database, computes the minimum format to represent the largest series numbers and the minimum number of fractional digits, and stores the format in a custom column. I can post it tomorrow if anyone is interested and if I can find it.
|