R. Barzell
0
Q:

perl format decimal 2 places not rounding

my $places = 2;
my $factor = 10**$places;
int(1.555 * $factor) / $factor;  # 1.55
0

Tags

New to Communities?

Join the community