0

i have this code where i need to round a number up or down to the nearest thousand, the rouding up method i did works perfectly but it seems to not be working well when i try to turn it into a rounding down method. code:

follow4 = (followers / 100) % 10
if followers % 1000 != 0:
    if follow4 >= 5:
        follow = followers / 1000
        follow2 = math.ceil(follow)
        follow3 = follow2 * 1000
    elif follow4 < 5:
        follow = followers * 1000
        follow2 = math.floor(follow)
        follow3 = follow2 / 1000
Punz
  • 15
  • 5

0 Answers0