summaryrefslogtreecommitdiff
path: root/tests/test_support.py
diff options
context:
space:
mode:
authorJonah Lawrence <jonah@freshidea.com>2022-11-04 09:16:24 -0600
committerGitHub <noreply@github.com>2022-11-04 17:16:24 +0200
commit5fcc2535f96bfce9c1a1ecf9d19a976b9bf6ab6b (patch)
treea7871ea693786fe78eb10c5ff92e30926a71bfbb /tests/test_support.py
parent3add2c141783b1f590c753f475b8cba64d15cd0c (diff)
downloadbabel-5fcc2535f96bfce9c1a1ecf9d19a976b9bf6ab6b.tar.gz
feat: Support for short compact currency formats (#926)
Co-authored-by: Jun Omae (大前 潤) <42682+jun66j5@users.noreply.github.com>
Diffstat (limited to 'tests/test_support.py')
-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 93ad37e..9447107 100644
--- a/tests/test_support.py
+++ b/tests/test_support.py
@@ -334,6 +334,11 @@ def test_format_compact_decimal():
assert fmt.compact_decimal(1234567, format_type='long', fraction_digits=2) == '1.23 million'
+def test_format_compact_currency():
+ fmt = support.Format('en_US')
+ assert fmt.compact_currency(1234567, "USD", format_type='short', fraction_digits=2) == '$1.23M'
+
+
def test_format_percent():
fmt = support.Format('en_US')
assert fmt.percent(0.34) == '34%'