[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-merchant-frontend-examples] 01/02: Half-baking strin
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-merchant-frontend-examples] 01/02: Half-baking string_to_amount |
Date: |
Tue, 21 Feb 2017 11:12:00 +0100 |
This is an automated email from the git hooks/post-receive script.
marcello pushed a commit to branch master
in repository merchant-frontend-examples.
commit 7c068c6cbc8584d19b90b3822e9874574a0c35a5
Author: Marcello Stanisci <address@hidden>
AuthorDate: Mon Feb 20 21:59:26 2017 +0100
Half-baking string_to_amount
---
Python/lib/pytaler/amounts.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/Python/lib/pytaler/amounts.py b/Python/lib/pytaler/amounts.py
index ee7b0d1..c1821de 100644
--- a/Python/lib/pytaler/amounts.py
+++ b/Python/lib/pytaler/amounts.py
@@ -14,11 +14,18 @@
#
# @author Marcello Stanisci
+import re
+
FRACTION = 100000000
def amount_get_zero(currency):
return {"value": 0, "fraction": 0, "currency": currency}
+def string_to_amount(fmt):
+ pattern = re.compile("^[0-9]+\.[0-9]+:[A-Z]+$")
+ assert(pattern.match(fmt))
+ # TBD
+
def amount_sum(a1, a2):
assert(a1['currency'] == a2['currency'])
--
To stop receiving notification emails like this one, please contact
address@hidden