That code assumed the unit name is "mmol". I am using @kdisimone's Loop "anna" branch that automatically uploads profiles to nightscout. If I access mysite/api/v1/profile/current, my unit name is instead "mmol/L". this results in autotuneweb running with an isf that is not multiplied with 18 even though is should.
Suggested fix:
private decimal ToMgDl(decimal value)
{
if (this.Units.ToLower().Contains("mmol"))
return value * 18;
return value;
}
https://github.com/MarkMpn/AutotuneWeb/blob/68216f90babaf5452a243eb98de7c61819a7ff71/AutotuneWeb/Models/NSProfile.cs#L129
That code assumed the unit name is "mmol". I am using @kdisimone's Loop "anna" branch that automatically uploads profiles to nightscout. If I access mysite/api/v1/profile/current, my unit name is instead "mmol/L". this results in autotuneweb running with an isf that is not multiplied with 18 even though is should.
Suggested fix: