From c4d76438cf8cff0d3d2e5a66f679272d00e93a58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Sat, 27 Mar 2021 18:01:10 +0000 Subject: Round mg/dL conversion to one decimal place. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is only affecting accucheck_reports for now, but it makes sure that a round-trip between mmol/L→mg/dL→mmol/L don't lose (or invent) precision. --- glucometerutils/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glucometerutils/common.py b/glucometerutils/common.py index de5d293..2760ce8 100644 --- a/glucometerutils/common.py +++ b/glucometerutils/common.py @@ -51,7 +51,7 @@ def convert_glucose_unit(value: float, from_unit: Unit, to_unit: Unit) -> float: if from_unit == Unit.MG_DL: return round(value / 18.0, 2) - return round(value * 18.0, 0) + return round(value * 18.0, 1) @attr.s(auto_attribs=True) -- cgit v1.2.3