+ 1
How this function rounds off the value?... Please explain.
a=round(1234.1234,-1) print (a)
4 Réponses
+ 5
the first parameter is the float number which will be rounded, and the second is how many digits after the . (dot) will be rounded.
if the second parameter is negative then it will round behind the dot instead of after, therefore:
round(1234.1234, -1) will result in 1230.0
because 34 rounded is 30
round(1236.1234, -1) will result in 1240.0
because 36 rounded is 40
round(1234.1234, -2) will result in 1200.0
because 23 rounded is 20
+ 2
i reedited the answer just for that, look above
0
And what about round (1234.1234,-2)
0
Thanks a lot...@@