From 69591748636b4fcf2505efd8ccd4e70d7658942b Mon Sep 17 00:00:00 2001 From: tim Date: Wed, 3 Jan 2018 23:38:37 +0200 Subject: [PATCH] Fix unit detection. --- glucometer_graphs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glucometer_graphs.py b/glucometer_graphs.py index b8c700b..d3b7dc0 100755 --- a/glucometer_graphs.py +++ b/glucometer_graphs.py @@ -704,7 +704,7 @@ def verify_units(units = None, high = None, low = None): ''' Standardise units for output and for the A1c calculations ''' if re.search('mg', units, flags=re.IGNORECASE) is not None: units = UNIT_MGDL - elif re.search('mg', units, flags=re.IGNORECASE) is not None: + elif re.search('mm', units, flags=re.IGNORECASE) is not None: units = UNIT_MMOLL elif isinstance(high, (int, float)) or isinstance(low, (int, float)): ''' If units are not specified by the arguments or calling function, let's assume they are