How to format number the same way calculators do
Hello all,
I would like to use the Format function to achieve the following:
1.234567 - 1.23457
1.23456 - 1.23456
1.2345 - 1.2345
1.234 - 1.234
1.23 - 1.23
1.2 - 1.2
1 - 1
(maximum 5 digits after the decimal point)
Note that the last result has no dot.
I have tried Format(1,"#.#####") but I get "1." and I don't want the dot.
Can someone help me to find the correct pattern?
Thank you
Stefano Gatto, Geneva
PS: I also posted this in the VBA forum of msdn.
|