When a float becomes long enough PHP seems to have trouble giving back the correct rounded number. Is there an alternate way of rounding to give back the expected number?
echo round(104045.7549999995, 2) // yields: 104045.76 wrong
echo round(104045.754999995, 2) // yields: 104045.75
Comparing that to JS, we get the expected correct values every time:
Math.round(104045.7549999995*100)/100; // yields: 104045.75
Math.round(104045.754999995*100)/100; // yields: 104045.75
It looks like PHP only looks ahead X number of decimals places.
Edit: I have now tested in Postgres as well:
select round(104045.7549999995, 2); // yields: 104045.75
select round(104045.754999995, 2); // yields: 104045.75