#!usr/bin/perl use strict; use warnings; my $j=0; for (1..800) #loop 800 times { $j+= 0.01; printf ("%0.2f\t", $j); #2 decimal places } __END__ Output: 0.01 0.02 0.03 0.04 0.05 0.06 ...... 7.95 7.96 7.97 7.98 7.99 8.00 Process completed successfully
In reply to Re: decimal calculation
by Marshall
in thread decimal calculation
by bestfa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |