Would love to know the best way to handle numbers with precision in Perl. These numbers (ie: strings) may come from anywhere such as a database, a spread sheet etc What is the best way to clean them, add them, multiply them with confidence? :) Thanks in advance.my $a = 000.76; my $b = 4; my $c = $a * $b; print $c; 304 my $a = .76; my $b = 4; my $c = $a * $b; print $c; 3.04 my $a = 0.76; my $b = 4; my $c = $a * $b; print $c; 3.04 my $a = 0000.76; my $b = 4; my $c = $a * $b; print $c; 304 my $a = 0000.76 + 0; my $b = 4; my $c = $a * $b; print $c; 304 my $a = .76; my $b = 4; my $c = $a * $b; print $c; 3.04 my $a = "000.76"; my $b = 4; my $c = $a * $b; print $c; 3.04
In reply to Perl with precision by AlienSpaces
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |