You can "round" the decimals of a number with a function.
Create a function that can accept two parameters, the first parameter "value" will be the value that will be truncated, and the second parameter "precision" will be the amount of decimals the value will have after the calculation. The function should return this value:
round(value * (10 ^ precision)) / (10 ^ precision)
Hope this can help you.