Skip to content

Commit 51b6761

Browse files
Jesse Harwinashb
authored andcommitted
Added test for extra decimal places for subsecond strings
1 parent 58b935d commit 51b6761

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/duration/test_in_words.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,14 @@ def test_subseconds():
6565
assert pi.in_words() == "0.12 seconds"
6666

6767

68+
def test_subseconds_with_n_digits():
69+
pi = pendulum.duration(microseconds=123456)
70+
71+
assert pi.in_words(seconds_n_decimal=3) == "0.123 seconds"
72+
73+
6874
def test_subseconds_with_seconds():
6975
pi = pendulum.duration(seconds=12, microseconds=123456)
70-
7176
assert pi.in_words() == "12 seconds"
7277

7378

0 commit comments

Comments
 (0)