Skip to content

Commit

Permalink
bring back the ' U' for non-SMB's (> 1U insulin and with carbs)
Browse files Browse the repository at this point in the history
  • Loading branch information
PieterGit committed Oct 27, 2017
1 parent 2f33b74 commit edbf22b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/client/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit edbf22b

Please sign in to comment.