php 20%
Posted: Wed Apr 25, 2012 12:58 pm
Hi Guys,
I want to take 20% off my product price which is 006385 it has to be like this as HSBC accept them this way, this means that the product price is $63.85.
I tried this:
the above $TwePercent outout is:1277
$PriceWithTwenPercOff is outputing: 6374.8
I think the $PriceWithTwenPercOff should be 005108 ($51.08).
So over all, how to get the 80% of the 006385, how can I achieve this keeping the format this way like 51.85 will read 005185?
Joe
I want to take 20% off my product price which is 006385 it has to be like this as HSBC accept them this way, this means that the product price is $63.85.
I tried this:
Code: Select all
$TwePercent = 006385 * 0.2; // get the 20% amount
$PriceWithTwenPercOff = 006385 - $TwePercent; // the price after we take the 20% off
$PriceWithTwenPercOff is outputing: 6374.8
I think the $PriceWithTwenPercOff should be 005108 ($51.08).
So over all, how to get the 80% of the 006385, how can I achieve this keeping the format this way like 51.85 will read 005185?
Joe