Ask Your Question
1

Number format code to display x significant figures [closed]

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

James Haigh gravatar image

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

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
0

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

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

Thanks!

edit flag offensive delete link more
1

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

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
0

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

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

Comments

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.

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

I've added some more examples.

James Haigh gravatar imageJames Haigh ( 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.

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

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

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

Question Tools

1 follower

Stats

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

Seen: 2,591 times

Last updated: Mar 01 '13