About 304,000 results
Open links in new tab
  1. python - How do you round UP a number? - Stack Overflow

    May 5, 2017 · How does one round a number UP in Python? I tried round (number) but it rounds the number down. Here is an example: round (2.3) = 2.0 and not 3, as I would like. Then I tried …

  2. How to properly round-up half float numbers? - Stack Overflow

    @simomo Python's round() function used to round up in older versions, but they switched the rounding strategy to half to even in Python 3. It was a deliberate choice because this produces …

  3. python - How to round a floating point number up to a certain …

    Jan 22, 2015 · Here, num is the decimal number. x is the decimal up to where you want to round a floating number. The advantage over other implementation is that it can fill zeros at the right …

  4. Round up to second decimal place in Python - Stack Overflow

    How can I round up a number to the second decimal place in Python? For example: 0.022499999999999999 Should round up to 0.03 0.1111111111111000 Should round up to …

  5. math - Python round up integer to next hundred - Stack Overflow

    Jan 14, 2012 · Rounding is typically done on floating point numbers, and here there are three basic functions you should know: round (rounds to the nearest integer), math.floor (always …

  6. python - How to round up a value with any decimal - Stack Overflow

    Jun 5, 2014 · I want to make the value always round up no matter what it is, so example: Strength = 16.33333 What would I use on that to make it (No matter what it equals) round up to the next …

  7. Why does Python 3 round half to even? - Stack Overflow

    Python 3's way (called "round half to even" or "banker's rounding") is considered the standard rounding method these days, though some language implementations aren't on the bus yet. …

  8. python - How to round float 0.5 up to 1.0, while still rounding 0.45 …

    May 8, 2017 · It appears that the default Python round (1 / 2) gives 0. How to round float 0.5 up to 1.0, while still rounding 0.45 to 0.0, as the usual school rounding?

  9. round() doesn't seem to be rounding properly - Stack Overflow

    The documentation for the round() function states that you pass it a number, and the positions past the decimal to round. Thus it should do this: n = 5.59 round(n, 1) # 5.6 But, in actuality, …

  10. python - Round number to nearest integer - Stack Overflow

    As @plowman said in the comments, Python's round() doesn't work as one would normally expect, and that's because the way the number is stored as a variable is usually not the way …