Answers for "limit to 2 decimals python"

3

how do i limit decimals to only two decimals in python

answer = str(round(answer, 2))
Posted by: Guest on May-24-2020
0

python limit float to 2 decimal places

In [1]: x = float(0.4343241231235)

In [2]: round(x, 2)
Out[2]: 0.43
Posted by: Guest on October-07-2021

Python Answers by Framework

Browse Popular Code Answers by Language