About 19,200,000 results
Open links in new tab
  1. Round integer in python without using round () - Stack Overflow

    Actually, you can do it without any builtins using the // operator: ... >>> round(15.) >>> round(25.) Of course, this always rounds down. If you want to round up for values with a remainder …

  2. rounding - Round without round function python - Stack Overflow

    Jul 16, 2013 · to do it without math just use strings (it still uses math) "%0.1f" % my_num_to_round

  3. python - how to round a float number without using round ()

    Write code that rounds a float number up or down without using the round() function introduced in Section 1.7. That is, write code that asks for a number, and then it takes that number and …

  4. How To Round In Python Without Using The Round Function?

    There are different ways to round the number in python without using the round function. In this article we will mostly talk two ways: Syntax: Rounding all number. Output: What to use instead …

  5. how to round without using round() : r/learnpython - Reddit

    Sep 4, 2023 · user_input = int(input("Number of digits to round to: ") rounding = 10 ** user_input mypi = int(pi * rounding) / rounding Or if you want to do it a bit more concisely: mypi = int(pi * …

  6. Round without round() function? : r/learnpython - Reddit

    I want my program to round a value to two decimal places and keep it as a float instead of a string. For example, a = format(1624/164, ".2f") '9.90'…

  7. How to Round Numbers in Python? - GeeksforGeeks

    Dec 8, 2023 · The round_() function in NumPy rounds the elements of an array to a specified number of decimal places. This function is extremely useful when working with floating-point …

  8. Python Round Function: Rounding Numbers in Python

    Apr 1, 2025 · Q #4) How do you round off without using the round function in Python? Answer: To round up or down without the built-in round(), we first multiply the number to be rounded by …

  9. Round Up Numbers in Python Without math.ceil() - AskPython

    Jun 28, 2023 · In this tutorial, we have seen two methods which can replace the math.ceil() function for calculating the ceiling of floating point data types. The round() function is one of …

  10. Python setting Decimal Place range without rounding?

    Mar 25, 2015 · Without "rounding", thus truncating the number. import decimal from decimal import ROUND_DOWN decimal.getcontext().prec=4 pi*1 #print Decimal('3.142') …

  11. Some results have been removed
Refresh