About 24,700,000 results
Open links in new tab
  1. 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.

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

    h = round(h) to assign the new value to h. 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 …

  3. 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, good...

  4. 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 int …

  5. python - How to round a floating point number up to a certain decimal ...

    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 end of …

  6. python - Limiting floats to two decimal points - Stack Overflow

    Jan 19, 2009 · From Python 3 documentation page: Note The behavior of round() for floats can be surprising: for example, round(2.675, 2) gives 2.67 instead of the expected 2.68.

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

    The Numeric Types section documents this behaviour explicitly: round(x[, n]) x rounded to n digits, rounding half to even. If n is omitted, it defaults to 0. Note the rounding half to even. This is also …

  8. python - How to round the minute of a datetime object - Stack Overflow

    I have a datetime object produced using strptime (). >>> tm datetime.datetime (2010, 6, 10, 3, 56, 23) What I need to do is round the minute to the closest 10th minute. What I have been doi...

  9. python - round a single column in pandas - Stack Overflow

    Oct 1, 2014 · 92 .round () is a pandas method and it applies to the output format rather than the underlying value. If you have floats with many decimal places you can instead apply the Python …

  10. python - Rounding floats with f-string - Stack Overflow

    But either way, this title "Rounding floats with f-string" and tagging python-3.6 is much better, clearer, wording, legible and better search keyword coverage or duplicate than "Convert floating point …