coppocks
12-16-2006, 09:08 PM
I've got an issue whereas a client server has an older version of PHP that does not have gmp or bc precision mathematics available.
I have a function that multiplies 2 values and returns the result to a read only text field.
Whereas I might need this result to be displayed: 7972.01
His server is displaying: 8
Normally I would do this...
$value = bcmul($amount, $rate, '10');
... to return necessary values like 7972.01 or 7972.012364 etc. However, his server is returning bcmul as an "undefined function" ... and this won't fly either:
$value = ($amount * $rate);
I have no code in there that performs any rounding operations what-so-ever. Any suggestion as to how to fix this?
I have a function that multiplies 2 values and returns the result to a read only text field.
Whereas I might need this result to be displayed: 7972.01
His server is displaying: 8
Normally I would do this...
$value = bcmul($amount, $rate, '10');
... to return necessary values like 7972.01 or 7972.012364 etc. However, his server is returning bcmul as an "undefined function" ... and this won't fly either:
$value = ($amount * $rate);
I have no code in there that performs any rounding operations what-so-ever. Any suggestion as to how to fix this?