I know that the number of decimal places can be given by using 0’s. However, I want to be able to display values to 4SF.
1.2345 -> '1.235'
12.345 -> '12.35'
123.45 -> '123.5'
1234.5 -> '1235'
12345 -> '12350'
0.1 -> '0.1000'
1 -> '1.000'
10 -> '10.00'
100 -> '100.0'
1000 -> '1000'
Used in combination with this, I want to ultimately be able to express any value in this way:
1.2345 -> '1.235 '
123456 -> '123.5k'
12345678900000 -> '12.35T'
0.0000012345 -> '1.235μ'
This is for SI units. See metric prefix.