summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJonah Lawrence <jonah@freshidea.com>2022-11-02 00:35:41 -0600
committerGitHub <noreply@github.com>2022-11-02 08:35:41 +0200
commit103c214dcf57e53f8f18b30f59947c9752c18ab2 (patch)
tree02785d54dfabe87f951d939321d5659686bc373a /tests
parentf7af1b72e765278b3431de3f3b92c6b9a189b18e (diff)
downloadbabel-103c214dcf57e53f8f18b30f59947c9752c18ab2.tar.gz
feat: Add `Format.compact_decimal` utility (#921)
Diffstat (limited to 'tests')
-rw-r--r--tests/test_support.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/test_support.py b/tests/test_support.py
index 2d8e933..93ad37e 100644
--- a/tests/test_support.py
+++ b/tests/test_support.py
@@ -329,6 +329,11 @@ def test_format_decimal():
assert fmt.decimal(1.2345) == '1.234'
+def test_format_compact_decimal():
+ fmt = support.Format('en_US')
+ assert fmt.compact_decimal(1234567, format_type='long', fraction_digits=2) == '1.23 million'
+
+
def test_format_percent():
fmt = support.Format('en_US')
assert fmt.percent(0.34) == '34%'