Save python-digit decimal type float

= 5.026 A 
B = 5.000 # two decimals method 
# . 1, round (NUM, n-) Print (round (A, 2))    # 5.03, the obtained is a float type # 2,% Method Print (float ( ' % .2f ' % a))    # 5.03, the obtained is a float type # . 3, Print ( ' {X: .2f} ' .format (X = a))    # 5.03, this is obtained str
 







 

Guess you like

Origin www.cnblogs.com/baicai37/p/12619280.html