Answers for "how to rounde floats to one decimal inc"

5

round off float to 2 decimal places in python

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

Round Decimal

Number((2.935).toFixed(2)) //2.94
Number((12.349345).toFixed(4)) //12.2493
Number((2.5398).toFixed(3)) //2.540

Number((1.005).toFixed(2)) //outputs 1 instead of 1.01
Number((1.555).toFixed(2)) //outputs 1.55 instead of 1.56
Posted by: Guest on January-07-2022

Code answers related to "how to rounde floats to one decimal inc"

Python Answers by Framework

Browse Popular Code Answers by Language