Round to Decimals

Round a floating-point number to a specified number of decimal places for precision control.

Code

General
round(num, decimals)

Parameters

The number to round

Number of decimal places

Server

More Python Snippets