約760,000件1ページ目

日本語のみで絞り込む

2016/12/7 -I may be missing something essential, but I can't figure out a way to 'properly' round floats/Decimals in Python (2.7), at least to three ...

他の人はこちらも質問

The round() function returns a floating point number that is a rounded version of the specified number, with the specified number of decimals. The default ...

2026/3/20 -round() is a built-in Python function used to round numbers to a specified number of decimal places. If only the number is provided, ...

The round(number, ndigits) function rounds the number number to ndigits decimal places. If ndigits is omitted, it rounds to the nearest integer. It is important ...

2017/9/10 -Alternatively, you can use Python 3.6's f-strings. "{a}".format(a=a) can be replaced with f"{a}" .

2023/4/4 -Hello, Is it possible to round a number to the amount of digit it has. import math a = 984.59 x = round(a - math.floor(a) , 2) print(x) In ...

2026/10/18 -To round numbers to specific decimal places, you can use the round() function with a second argument specifying the number of decimals. For more ...

2025/3/10 -Rounding with round(). For basic calculations where you just need to control decimal places, the round() function can be a quick and effective ...

The float printing routines use an accurate but much more computationally demanding algorithm to compute the number of digits after the decimal point.

2022/5/24 -We'll then talk about the math.ceil() and math.floor() methods which rounds up and rounds down a number to the nearest whole number/integer ...