# Number format code to display x significant figures [closed]

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.

edit retag reopen merge delete

### Closed for the following reason the question is answered, right answer was accepted by Alex Kemp close date 2016-02-18 06:44:51.725931

Sort by » oldest newest most voted

Hi @James Haigh,

Sounds like we've gotten pretty close to a complete answer for you, but the formatting remains elusive. Perhaps a 'feature request' could solve this at a deeper level inside the code base.

Please post a link to any bugs you file in a comment below using the format "fdo#123456".

Thanks!

more

James, I don't think you can solve your brain teaser just with the formatting function of CALC.

Consider writing a macro/userdefined Function to do it.

more

Let me sketch the work around idea I have.

Use column 1 to enter all the raw data you get, use column 2 (maybe with IF-statements to identify the multiplier you need) to mulriply the column 1 figures to get the "format" you need use column 3 to display figure like 1.234mA

You can hide column 2

If above works, yoiu also should be able to combine column 2 and 3.

more

I am not sure if I understand "4SF" but I assume you mean 4 digits behind the decimal point. Then I would use the format 0.#### With this answer I am neglecting all divisions by 1000 and multiplications by 100 because I don't know yet a solution for avoiding the display of %.

more

1

4SF is an abreviation for 4 significant figures. None of the first block of examples given above can be achieved with 0.####, nevermind all of them.

( 2012-11-09 18:46:26 +0200 )edit

( 2012-11-09 18:57:15 +0200 )edit
1

@James Haigh you can do it with 0.000, 00.00, 000.0 etc. individually except 12345 -> 12350. Or use scientific format 0.000E-00 to get your 4SF, works with all numbers.

( 2012-11-10 19:54:05 +0200 )edit