I have no idea how to do this since the only rounding function is to integers.
I tried dividing my variable by 100 to 100000 to try to lose data on the last decimals, but it didn’t work.
Any ideas?
I have no idea how to do this since the only rounding function is to integers.
I tried dividing my variable by 100 to 100000 to try to lose data on the last decimals, but it didn’t work.
Any ideas?
Is it possible to set the variable to a string and use the string slice function? It’s been a long while since I’ve launched OW but still pop on here to try to help
The problem is then you can’t use that stringyfied/truncated value for further calculations. If it is the goal to retirve such as final result etc. its fine to go, but thats it, you would need to back track and use the original value before truncating again for something else. Kinda of clunky and
Only the division by 100 would work any decimal digit at the position greater than 3 after the coma is cut out anyways if we want to representate decimal numbers with workshop like at debugging.
It doesn’t work.
Edit:
For anyone wondering, I’ve found a mathematical solution to the problem. Here’s an example:
Let's say I want to round 1.4913 to a float with only 1 decimal accuracy.
1.4913 * 10 = 14.913
14.913 ≈ 15 (using the round to nearest integer function)
15 / 10 = 1.5
voila.
So, Divide(Round To Integer(Multiply(*number*, Raise To Power(10, *precision*))), Raise To Power(10, *precision*))
Yes and the max of precision or number of digits to truncate is 3 for workshop.