From 16a47cbb3a4c60d72755bbac75111cdf9b7affc4 Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Fri, 10 Feb 2023 23:46:36 +1100 Subject: [PATCH] Allow unit-aware sort when doses expressed as concentrations --- html/index.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/html/index.html b/html/index.html index c2a72e7..06bea9b 100644 --- a/html/index.html +++ b/html/index.html @@ -250,17 +250,17 @@ let num2 = parseInt(bits2[i]); // Check for units - convert to grams - if (bits1.length > i + 1 && bits1[i + 1] == 'microgram') { + if (bits1.length > i + 1 && (bits1[i + 1] == 'microgram' || bits1[i + 1].startsWith('microgram/'))) { num1 /= 1000000; } - if (bits1.length > i + 1 && bits1[i + 1] == 'mg') { + if (bits1.length > i + 1 && (bits1[i + 1] == 'mg' || bits1[i + 1].startsWith('mg/'))) { num1 /= 1000; } - if (bits2.length > i + 1 && bits2[i + 1] == 'microgram') { + if (bits2.length > i + 1 && (bits2[i + 1] == 'microgram' || bits2[i + 1].startsWith('microgram/'))) { num2 /= 1000000; } - if (bits2.length > i + 1 && bits2[i + 1] == 'mg') { + if (bits2.length > i + 1 && (bits2[i + 1] == 'mg' || bits2[i + 1].startsWith('mg/'))) { num2 /= 1000; }