On my windows box when I run
$SR = "0";
$SPR = "149";
$SR = bcadd($SR, $SPR);
echo "$SR";
It outputs 149.0000000000
But when I upload the same code to my Linux host, the output is 149.
Why?
On my windows box when I run
$SR = "0";
$SPR = "149";
$SR = bcadd($SR, $SPR);
echo "$SR";
It outputs 149.0000000000
But when I upload the same code to my Linux host, the output is 149.
Why?
probably the "scale" is different on the two environments.
Try to set the scale with the bcscale function before doing your operations, For example:
Or simply use the third parameter in bcadd to set the scale: