round a number to 4 decimal places python code example Example: how to round a float in python round(number, ndigits)