Calc element 3 digits after comma

mvdw310

New Member
Dear All,

Is it possible to use only 2 digits after comma instead of 3.
Now my calculation gives 3 digits after comma.

I hope someone can tell me.

Grtz Manfred
 
What is your calc code?

-- hugh

Hello Hugh,

My code is :
$ontbijt = (((int)'{inschrijfformulier___ontbijt_raw}' * (int)'{inschrijfformulier___personen}' + 2500) + (int)'{inschrijfformulier___t_shirt_raw}') / 100;
$paypal =(0.35+(($ontbijt/100)*1.5));
$ontbijt2 = $ontbijt + ($paypal * (int)'{inschrijfformulier___paypal_raw}');
return $ontbijt2 . ' ' . 'Euro';

Grtz Manfred
 
Do ...

Code:
return round($ontbijt2, 2) . ' ' . 'Euro';

If you want 0 padding on the right, so (say) .2 is 0.20 ...

Code:
return sprintf('%.2f', round($ontbijt2, 2)) . ' ' . 'Euro';

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top