bring back the ' U' for non-SMB's (> 1U insulin and with carbs)

This commit is contained in:
PieterGit
2017-10-27 22:43:58 +02:00
parent bea449bd26
commit 0c171d6fa3
+6 -2
View File
@@ -444,9 +444,13 @@ function init (client, d3) {
}
if ( treatment.insulin > 0) {
var dosage_units = Math.round(treatment.insulin * 100)/100;
var unit_of_measurement = ' U'; // One international unit of insulin (1 IU) is shown as '1 U'
if ( treatment.insulin < 1 && !treatment.carbs ) { // don't show the unit of measurement for insulin boluses < 1 without carbs (e.g. oref0 SMB's). Otherwise lot's of small insulin only dosages are often unreadable
unit_of_measurement = '';
}
// remove leading zeros to avoid overlap with adjacent boluses
var units = Math.round(treatment.insulin * 100)/100;
arc_data[3].element = (units+"").replace(/^0/,"");
arc_data[3].element = (dosage_units+"").replace(/^0/,"")+unit_of_measurement;
}
if (treatment.status) {