Python rounding up float number -


this question has answer here:

i need results these:

2.1421 => 2.15 2.1401 => 2.15 2.14   => 2.14 

as @jerrybibo mentioned, you'll need use ceil function, , result nearest hundredths place, multiply number hundred, run through ceil , divide answer 100. can try in idle.

>>> math.ceil(2.1421 * 100) / 100 2.15 

hope helps.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -