Allow unit-aware sort when doses expressed as concentrations
This commit is contained in:
parent
eb40e2a950
commit
16a47cbb3a
@ -250,17 +250,17 @@
|
|||||||
let num2 = parseInt(bits2[i]);
|
let num2 = parseInt(bits2[i]);
|
||||||
|
|
||||||
// Check for units - convert to grams
|
// 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;
|
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;
|
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;
|
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;
|
num2 /= 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user