I have about 10-15 numbers with precision of 1, 2 or 3 decimals in my db, both signed and unsigned.
Example of datatypes being used:
decimal(10,3), decimal(10,2), decimal(10,1)
I'm calculating them in PHP something like this:
$result = ($value1from_col1 + ($value2from_col2 * 30)/500) * 0.453;
I'm then using some round()
functions like this:
$result_round = round($result, 2, PHP_ROUND_HALF_UP);
Result of $result_round
would be at largest: 100.000,999
I'm checking this: How much precision for a bcmath PHP library? and the answer states that it wouldn't be an issue if you're not using functions like round(), printf etc.
Should I use BCMath-extension then? (just because I'm using round()
)