J
Justin C
This one is really confusing me. I have a comparison:
$totalIndividualWeights != $param{weight}
and when they're both 42.6 (probably other numbers too, but this is the
problem someone has, and has come to me with) Perl says they're not the
same:
my $totalIndividualWeights = addIndividualWeights();
if ($totalIndividualWeights != $param{weight}){
print "Weight does not add up to total weight given on the first form.\$totalIndividualWeights = $totalIndividualWeights \n \$param{weight} = $param{weight}";
}
The print statement says both weights are 42.6. $param{weight} was
input by the user, $totalIndividualWeights is reached by adding several
user inputs: 2.86, 9.94, 9.98, 9.88, 9.94
Does perl have a problem with empty decimal places? What I mean is, the
inputs are to two decimals, but the result is only using one, is perl
thinking "42.60" and not matching 42.6?
Thank you for any help you can give with this.
Justin.
$totalIndividualWeights != $param{weight}
and when they're both 42.6 (probably other numbers too, but this is the
problem someone has, and has come to me with) Perl says they're not the
same:
my $totalIndividualWeights = addIndividualWeights();
if ($totalIndividualWeights != $param{weight}){
print "Weight does not add up to total weight given on the first form.\$totalIndividualWeights = $totalIndividualWeights \n \$param{weight} = $param{weight}";
}
The print statement says both weights are 42.6. $param{weight} was
input by the user, $totalIndividualWeights is reached by adding several
user inputs: 2.86, 9.94, 9.98, 9.88, 9.94
Does perl have a problem with empty decimal places? What I mean is, the
inputs are to two decimals, but the result is only using one, is perl
thinking "42.60" and not matching 42.6?
Thank you for any help you can give with this.
Justin.