Skip to content

Commit

Permalink
Merge pull request #32 from akintolga/master
Browse files Browse the repository at this point in the history
Date format and macro fix for 4 digit figures
  • Loading branch information
akintolga authored Jul 3, 2016
2 parents 803a2f2 + 4baa57d commit 5d366e6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions client/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,13 @@
embeds: false
};

config.view = {
timeformat: 'HH:mm',
dateformat: 'DD/MM/YYYY'
};

config.defaultTimezone = 'Australia/Sydney';

config.list = {
'priority': [
'priority',
Expand Down
2 changes: 1 addition & 1 deletion server/aap/macros/currency_usd_to_aud.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def usd_to_aud(item, **kwargs):
if os.environ.get('BEHAVE_TESTING'):
rate = USD_TO_AUD

regex = r'((\$US)|(\$)|(USD)|(\$US))\s*\-?\s*\(?(((\d{1,3}((\,\d{3})*|\d*))?' \
regex = r'((\$US)|(\$)|(USD)|(\$US))\s*\-?\s*\(?(((\d{1,4}((\,\d{3})*|\d*))?' \
r'(\.\d{1,4})?)|((\d{1,3}((\,\d{3})*|\d*))(\.\d{0,4})?))\)?' \
+ currency_base.SUFFIX_REGEX

Expand Down
2 changes: 2 additions & 0 deletions server/aap/macros/currency_usd_to_aud_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class CurrencyTestCase(unittest.TestCase):

def test_usd_to_aud(self):
text = 'This is a $ 40 note. ' \
'This is a $ 1000 note. ' \
'This is a $41 note. ' \
'This is a $(42) note. ' \
'This is a $46,483 note. ' \
Expand Down Expand Up @@ -46,6 +47,7 @@ def test_usd_to_aud(self):
item = {'body_html': text}
res, diff = usd_to_aud(item, rate=Decimal(2))
self.assertEqual(diff['$ 40'], '$ 40 ($A80)')
self.assertEqual(diff['$ 1000'], '$ 1000 ($A2,000)')
self.assertEqual(diff['$41'], '$41 ($A82)')
self.assertEqual(diff['$(42)'], '$(42) ($A84)')
self.assertEqual(diff['$46,483'], '$46,483 ($A92,966)')
Expand Down

0 comments on commit 5d366e6

Please sign in to comment.