About 271,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

    If you need more control over the rounding behaviour, use the decimal module, which lets you specify exactly what rounding strategy should be used. For example, to round up from half:

  3. 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 …

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

  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 numbers to the nearest 1000? - Stack …

    Sep 29, 2017 · 16000 >>> round(1218, -3) 1000 So the short answer is: Call round with the second argument of -3 to round to the nearest 1000. A minor warning since it surprises …

  9. python - Round with integer division - Stack Overflow

    Apr 8, 2014 · And to add on what Gregory noted, with this rounding strategy it is semantically different from python's round function used by OP in the question, which also rounds 0.5 …

  10. python - Rounding a math calculation up, without math.ceil ()?

    Jul 19, 2019 · Because, round() is a standalone function in python and not an extension of math package. So, I suggest you go on and simply use round() instead of math.round() and you'll be …