Basically I would like to have the format as "0.###"
which means it shows up to 3 decimals if they are all non-zero. Otherwise it won't display the decimal at all.
For instance,
1234.56789 --> 1234.568
1234.56989 --> 1234.57
1234.99951 --> 1235
1234.00049 --> 1234
Ideally it would also do comma separate as 100,000,000 for 100 million.
Thanks.
No there is no magical standard way of formatting the code as you seem to desire. You'll need to write code to do the formatting.