bear0053 has asked for the wisdom of the Perl Monks concerning the following question:
Why?? Thanks again.my $batch_total = 297; my $batch_sign_indicator = '-'; my $close_response; $close_response->{batch_net_amount} = -2.97; #this code doesn't work. it returns false my $test_batch_amount = ($batch_sign_indicator eq '-') ? ((0 - $batch_ +total) / 100) : ($batch_total / 100); if($test_batch_amount == $close_response->{batch_net_amount}){ print "good!!! $test_batch_amount == $close_response->{batch_net_a +mount}"; } else{ print "no good $test_batch_amount == $close_response->{batch_net_a +mount}"; } ####THIS CODE DOES WORK AS EXPECTED AND RETURNS TRUE my $test_batch_amount = ($batch_sign_indicator eq '-') ? ((0 - $batch_ +total)) : ($batch_total); if($test_batch_amount == ($close_response->{batch_net_amount}*100)){ print "good!!! $test_batch_amount == $close_response->{batch_net_am +ount}"; } else{ print "no good $test_batch_amount == $close_response->{batch_net_am +ount}"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: inequality of appearing same number
by davido (Cardinal) on Dec 01, 2004 at 18:09 UTC | |
|
Re: inequality of appearing same number
by Roy Johnson (Monsignor) on Dec 01, 2004 at 18:15 UTC | |
|
Re: inequality of appearing same number
by dragonchild (Archbishop) on Dec 01, 2004 at 18:00 UTC | |
|
Re: inequality of appearing same number
by Anonymous Monk on Dec 01, 2004 at 21:47 UTC | |
by bear0053 (Hermit) on Dec 02, 2004 at 00:21 UTC |