M
Max Williams
I have a requirement where i need to display (ie convert to a string)
all digits to 3 significant figures. (not the same as 3 decimal places)
eg
23 => "23"
26759 => "26,800"
10.546 => "10.5"
3332332 => "3,330,000"
0.766 => "0.766"
0.00000766 => "0.00000766"
Can anyone show me a neat way to do this? I'd have thought that there'd
be a method for it already but i can't find one.
thanks!
max
all digits to 3 significant figures. (not the same as 3 decimal places)
eg
23 => "23"
26759 => "26,800"
10.546 => "10.5"
3332332 => "3,330,000"
0.766 => "0.766"
0.00000766 => "0.00000766"
Can anyone show me a neat way to do this? I'd have thought that there'd
be a method for it already but i can't find one.
thanks!
max