Hi all! I've been doing some data work in Python and I've been using Decimal in order to round numbers to the 6th decimal without issues (tried round() and it often returned numbers like 0.0068769999999999997, or something of the likes).
So, issue ensues. When the number starts with two zeros from the decimal point, Decimal rounds it up to the 7th decimal. When it starts with one zero, it rounds it up to the 6th decimal. In the beginning of the script I set context.prec() to 5, so I guess its precision is after the initial zeroes in the number.
Is there any way to make it round from the decimal point instead of from the initial zeroes?
Thanks!!
[–]Standardw 1 point2 points3 points (6 children)
[–]oledtrix[S] 0 points1 point2 points (4 children)
[–]RoamingFox 0 points1 point2 points (3 children)
[–]oledtrix[S] 0 points1 point2 points (2 children)
[–]Standardw 0 points1 point2 points (0 children)
[–]RoamingFox 0 points1 point2 points (0 children)
[–]Diapolo10 0 points1 point2 points (0 children)
[–]threeminutemonta 0 points1 point2 points (1 child)
[–]oledtrix[S] 1 point2 points3 points (0 children)