T
ThePotPlants
Hi
Is there a nice way of formatting a decimal to have a fixed number of
trailing zero's?
I am decimalising some data to feed into another application. The input
requires 6 decimal places.
Using sprintf I can apply various formats, like leading zero's but can't
figure out how to add trailers...
For most of my data it's not a problem, but I have a couple of oddities that
divide neatly leading me with 4 decimal places.
One example I have. After conversion I get: 0.1029 but I want 0.102900.
At the moment I am multiplying my variable by 100000 and doing a substr on
the leading 6 characters, but there must be a nicer way than this...
Any help would be much appreciated.
Pete
Is there a nice way of formatting a decimal to have a fixed number of
trailing zero's?
I am decimalising some data to feed into another application. The input
requires 6 decimal places.
Using sprintf I can apply various formats, like leading zero's but can't
figure out how to add trailers...
For most of my data it's not a problem, but I have a couple of oddities that
divide neatly leading me with 4 decimal places.
One example I have. After conversion I get: 0.1029 but I want 0.102900.
At the moment I am multiplying my variable by 100000 and doing a substr on
the leading 6 characters, but there must be a nicer way than this...
Any help would be much appreciated.
Pete