We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b88f814 commit 80b297eCopy full SHA for 80b297e
strictdoc/helpers/math.py
@@ -6,8 +6,6 @@ def round_up(number: float, decimals):
6
assert isinstance(number, float)
7
assert isinstance(decimals, int)
8
assert decimals >= 0
9
- if decimals == 0:
10
- return ceil(number)
11
12
factor = 10**decimals
13
tests/unit/strictdoc/helpers/test_math.py
@@ -0,0 +1,10 @@
1
+from strictdoc.helpers.math import round_up
2
+
3
4
+def test_round_up():
5
+ assert round_up(1.3333, 0) == 2
+ assert round_up(1.3333, 1) == 1.4
+ assert round_up(1.3333, 2) == 1.34
+ assert round_up(1.3333, 3) == 1.334
+ assert round_up(1.3333, 4) == 1.3333
+ assert round_up(1.3333, 5) == 1.3333
0 commit comments