Add filter for formatting dollar values

This commit is contained in:
Patrick Smith
2018-08-20 11:00:40 -04:00
parent 2f62aebd57
commit cfc76f5137
3 changed files with 25 additions and 1 deletions

15
tests/test_filters.py Normal file
View File

@@ -0,0 +1,15 @@
import pytest
from atst.filters import dollars
@pytest.mark.parametrize("input,expected", [
('0', '$0'),
('123.00', '$123'),
('1234567', '$1,234,567'),
('-1234', '$-1,234'),
('one', '$0'),
])
def test_dollar_fomatter(input, expected):
assert dollars(input) == expected