← How-To Guides How-To How to round a number Use round(x, n) for rounding to n decimals. Use math.floor / ceil for down/up. round round(3.14159, 2) → 3.14. x = round(3.14159, 2) import math f = math.floor(3.7) # 3