Expose rates.group_int for space-grouped integers
This commit is contained in:
1 parent
f7106e8132
commit
9902d38b1e
1 file changed
+3
-2
@@ -97,8 +97,9 @@ def _apply_sign(negative, amount):
|
|||||||
return -amount if negative else amount
|
return -amount if negative else amount
|
||||||
|
|
||||||
|
|
||||||
def _group(digits):
|
def group_int(digits):
|
||||||
"""Insert spaces as thousands separators."""
|
"""Insert spaces as thousands separators into a whole number."""
|
||||||
|
digits = str(int(digits))
|
||||||
parts = []
|
parts = []
|
||||||
while len(digits) > 3:
|
while len(digits) > 3:
|
||||||
parts.insert(0, digits[-3:])
|
parts.insert(0, digits[-3:])
|
||||||
|
|||||||
Reference in new issue
Block a user