1

I've run into a strange phenomenon:

>>>round(15500,-3)
16000
>>>round(14500,-3)
14000
>>>round(13500,-3)
14000

Setting the ndigits argument to -3 should theoretically round to the nearest 1000. When at an ambiguous position like in the 500s, I would expect the default behavior to be consistent: either always rounding to the larger thousand or always to the smaller one, but it seems otherwise.

Mercury
  • 3,417
  • 1
  • 10
  • 35
  • Okay it seems like the round to the nearest even number in case of ambiguity still holds here in negative ndigits. Even though both 14000 and 15000 are even numbers, round is taking 14 and 15 into consideration as opposed to their thousands. – Mercury Jul 15 '20 at 20:42

0 Answers0