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; }