How can i get exactly 2 decimal position in python -
while writing code came around difficult situation, have float 2.467 need 2.4 not 2.5
when use roud() function gives 2.5
please me code how 2.4 2.47
>>> int(2.467 * 10) / 10.0 2.4 >>> int(2.47 * 10) / 10.0 2.4
Comments
Post a Comment