in reply to Re: A simple rounding question, but can't get it!
in thread A simple rounding question, but can't get it!

if ($coupon_style eq "A" && $subtotal-$acoup_not_allowed_for_this_part + >= $must_spend) { $take_off_this_much = ($coupon_amount/100) * ($subtotal-$acoup_n +ot_allowed_for_this_part); $a_take_off_this_much = sprintf ("%.2f", $take_off_this_much); $b_take_off_this_much = &display_price($a_take_off_this_much); $coup_work= sprintf("%.2f", $take_off_this_much); $rooker = sprintf ("%.2f", $take_off_this_much); $a1_num_grand_total = sprintf ("%.2f", $num_grand_total); $num_grand_total = $a1_num_grand_total; $fiddler = ($num_grand_total - $coup_work); $a_fiddler = &format_price($fiddler); $b_fiddler = &display_price($a_fiddler);
$a_take_off_this_much is what we are looking at here, say the actual number is 1.085, it returns 1.08 (bad).

I'm not sure I understand the second reply... (sorry, I'm quite new at this).

Thanks again,

Pete

Edit by tye

Replies are listed 'Best First'.
Re: Re: Re: A simple rounding question, but can't get it!
by shotgunefx (Parson) on Feb 01, 2002 at 04:11 UTC
    Need to use <code></code> tags around your code.

    -Lee

    "To be civilized is to deny one's nature."