hotshot has asked for the wisdom of the Perl Monks concerning the following question:
Hello guys!
I want to divide a number by 1000 and leave only one digit after the period even if the number divides with no remainder, for example:
I want to divide a number by 1000 and leave only one digit after the period even if the number divides with no remainder, for example:
How can I achive that (not by playing with printf and formats - %.01f).$xx = 12000/1000; # wanted result is 12.0 $yy = 12678/1000; # wanted result is 12.7 - rounded up
Back to
Seekers of Perl Wisdom