mirror of
https://github.com/bckelley/cgm-remote-monitor.git
synced 2026-08-24 03:14:12 -05:00
bring back the ' U' for non-SMB's (> 1U insulin and with carbs)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user