Ask Your Question

Number format code to display x significant figures [closed]

asked 2012-11-09 14:28:43 +0100

James Haigh gravatar image

updated 2012-11-09 18:53:21 +0100

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 flag offensive 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

4 Answers

Sort by » oldest newest most voted

answered 2013-03-01 07:12:05 +0100

qubit gravatar image

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 file an enhancement bug and provide as much information about this new feature as possible. Don't forget to mark your bug as an 'enhancement'. The QA team will be happy to help you triage your feature request in the bugtracker.

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


edit flag offensive delete link more

answered 2012-11-12 17:20:54 +0100

horst gravatar image

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.

edit flag offensive delete link more

answered 2012-11-10 12:25:46 +0100

ROSt52 gravatar image

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.

edit flag offensive delete link more

answered 2012-11-09 15:27:31 +0100

ROSt52 gravatar image

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 %.

edit flag offensive delete link more



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.

James Haigh gravatar imageJames Haigh ( 2012-11-09 18:46:26 +0100 )edit

I've added some more examples.

James Haigh gravatar imageJames Haigh ( 2012-11-09 18:57:15 +0100 )edit

@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.

horst gravatar imagehorst ( 2012-11-10 19:54:05 +0100 )edit

Question Tools

1 follower


Asked: 2012-11-09 14:28:43 +0100

Seen: 3,374 times

Last updated: Mar 01 '13