Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Without formatting, numbers are condensing after 5 decimal places.
Now I can format this to show all the numbers formatted to 10 decimal places, but I don't want the trailing zeros.
Is it possible to do this with only formatting functions? I'd rather not use string functions to remove the excess zeros.
=ValueLoop(1,10) | Desired Result |
---|---|
1 | 0.1 |
2 | 0.01 |
3 | 0.001 |
4 | 0.0001 |
5 | 0.00001 |
6 | 0.000001 |
7 | 0.0000001 |
8 | 0.00000001 |
9 | 0.000000001 |
10 | 0.0000000001 |
Thanks.
Thanks Sunny, but I think if I have to use string functions, I'll probably just stick to removing the trailing zeros like this: Replace(RTrim(Replace(Num(1/pow(10, ValueLoop(1,10)),'#.##########'),'0',' ')),' ','0')
Make sense.... there was one time when I thought that # meant optional and 0 meant definitive. But it seems that it might have gotten changed in one of the releases (I thought this would have worked ##.############, but it did not)
That's also what I had originally assumed, but I've never been able to see a difference between the two. Hopefully in a future release we will get a functioning optional character.
Hi Philip
Maybe you can build a logic like, lets say your value is
N = 12.0000008000
You can find no. Of significant digits after decimal
Use N-floor(N) =. 0000008000
Divide this number by 1, 1/.0000008000=1250000
Use log of this number, which returns 6.09, use ceil (6.09) which returns 7
Use this in the repeat function.
Hence your expression looks like
Num(N,'#.'&repeat ('#', ceil(log (1/(N-floor(N) )))))
THIS should work.
I couldnt try this out, sorry as I am travelling but something like this would definitely work for you.
Please check the expression before you use.
Regards
Pratyush
Yup, I agree