Welcome Guest, Not a member yet? Register   Sign In
Limit Characters for Currency
#1

[eluser]zeedy2k[/eluser]
ok, need slight bit of help here as its baffling me.

I have an amount but need to add VAT to that amount. Now, when I add the VAT (17.5%) to some of the figures it adds triple digit pence eg, £52.875. Is there an easy way to limit the pence to 2 digits?

Cheers
Robert
#2

[eluser]n0xie[/eluser]
Wouldn't it be easy if PHP has a function that solves these kind of problems? http://nl.php.net/manual/en/function.money-format.php
#3

[eluser]mddd[/eluser]
Code:
$val = 45;
$inc_vat = round( $val * 1.175, 2);
// $inc_vat = 52.88
#4

[eluser]zeedy2k[/eluser]
Thanks for the replies... found this one just before coming back here

$incvat = number_format($vat,2);
#5

[eluser]zeedy2k[/eluser]
[quote author="mddd" date="1280861958"]
Code:
$val = 45;
$inc_vat = round( $val * 1.175, 2);
// $inc_vat = 52.88
[/quote]

Thanks mddd thats perfect...




Theme © iAndrew 2016 - Forum software by © MyBB