Answers for "python round"

19

round to two decimal places python

>>> x = 13.949999999999999999
>>> x
13.95
>>> g = float("{0:.2f}".format(x))
>>> g
13.95
>>> x == g
True
>>> h = round(x, 2)
>>> h
13.95
>>> x == h
True
Posted by: Guest on March-25-2020
6

python round number numpy

x = np.round(x, decimals = 4)
Posted by: Guest on November-08-2020
18

python round up

>>> import math

>>> math.ceil(5.2)
6

>>> math.ceil(5)
5

>>> math.ceil(-0.5)
0
Posted by: Guest on December-08-2019
1

round python

round(number, decimalPlaces = 0)
Posted by: Guest on October-19-2021
13

python round to dp

round(float_num, num_of_decimals)
Posted by: Guest on March-07-2020
0

python round

round(number, digits)
    
    round(2.135, 2) #=2.14
    round(2.135, 0) #=2
Posted by: Guest on September-01-2021

Python Answers by Framework

Browse Popular Code Answers by Language