Answers for "perl round number to 2 decimal places"

0

perl format decimal 2 places not rounding

my $places = 2;
my $factor = 10**$places;
int(1.555 * $factor) / $factor;  # 1.55
Posted by: Guest on June-24-2020

Code answers related to "perl round number to 2 decimal places"

Browse Popular Code Answers by Language