Closed bjornoleh closed 44 minutes ago
Eventual BG as presented with this patch:
52,8 mmol/L to the left, 951 mg/dL to the right (random numbers from sim phone/watch/CGM and pump)
@bjornoleh there is a glucoseformatter also in ./FreeAPS/Sources/Modules/Home/View/Header/CurrentGlucoseView.swift which should fit perfectly for this issue
CurrentGlucoseView
Thanks for looking! That is in another file, right? I don't think that glucoseFormatter
will be accessible here. But I suppose my solution is a minimal and acceptable change, isn't it?
But I suppose my solution is a minimal and acceptable change, isn't it?
Totally!
As per discussion of targets and rounding errors leading to changed targets after multiple unit switches, I suspect that using https://github.com/nightscout/Trio/blob/20ba334b2c3b62ba296e67695bc015c4e5c868d4/FreeAPS/Sources/Modules/Home/View/Header/CurrentGlucoseView.swift#L13 would not lead to these. I think @polscm32 already centralized all formatters in Helpers at one point in some branch, which I guess is something we should also do. It only popped into my mind when viewing this PR as there are some inconsistencies in how rT.variables are handed over from oref to swift. Some are "convert_bg functioned" some always in md/dL - I think I am partly responsible for that and started fixing it, so I stumbled across glucoseformatter just this week.
@mountrcg , perhaps you can write up an issue about this for later?
Use
targetFormatter
instead ofnumberFormater
foreventualBG
in the app, since this has the appropriatemaximumFractionDigits = 1
Change eventualFormatter to use
maximumFractionDigits = 1
instead of2
on the watchResolves #319