mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
add util.number_format -> number_format
Jinja2 filter
Implement a `number_format` equivalent to PHP's version. Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
dc4cc9b604
commit
ac1779b705
3 changed files with 11 additions and 0 deletions
|
@ -30,3 +30,8 @@ def test_dedupe_qs():
|
|||
# Add key1=changed and key2=changed to the query and dedupe it.
|
||||
deduped = util.dedupe_qs(query_string, "key1=changed", "key3=changed")
|
||||
assert deduped == "key2=blah&key1=changed&key3=changed"
|
||||
|
||||
|
||||
def test_number_format():
|
||||
assert util.number_format(0.222, 2) == "0.22"
|
||||
assert util.number_format(0.226, 2) == "0.23"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue