Jump to content

Recommended Posts

I am trying to divide two numbers $TAP ($10,330,000.00) by $TOTP($26,250,000.00). When echo'd I get 0.3846, but a simple check on my calculator show the real answer is 0.3935. Anyone have any ideas? the difference makes the calculation worthless. I am using XAMPP, latest release, if thats of any help.

.

 

$B = ($TAP / $TOTP);

$C = $targetcontr;

$D = $maxvaluecontr;

$BCcalc = $B/$C;

$BCDcalc = ($BCcalc * $D);

$BCDcalcMIN = MIN($BCDcalc,$D);

echo $TAP."<br/>";

echo $TOTP."<br/>";

echo "The adjusted procurement ratio is : ".number_format($B,4)."<br/>";

The first comma , that is encountered in each number is a stop character. So, the result is 10/26.

 

Comma separators in numbers are there for human readability and don't belong in numbers in computers until the point where you want to output them in a human readable format.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.