mirror of
https://github.com/bckelley/cgm-remote-monitor.git
synced 2026-08-24 03:14:12 -05:00
20 lines
363 B
JavaScript
20 lines
363 B
JavaScript
'use strict';
|
|
|
|
var consts = require('./constants');
|
|
|
|
function mgdlToMMOL(mgdl) {
|
|
return (Math.round((mgdl / consts.MMOL_TO_MGDL) * 10) / 10).toFixed(1);
|
|
}
|
|
|
|
function mmolToMgdl(mgdl) {
|
|
return Math.round(mgdl * consts.MMOL_TO_MGDL);
|
|
}
|
|
|
|
function configure() {
|
|
return {
|
|
mgdlToMMOL: mgdlToMMOL
|
|
, mmolToMgdl: mmolToMgdl
|
|
};
|
|
}
|
|
|
|
module.exports = configure; |