Hi, I'd like to catch up on this old topic. I'm writing a datafield app that operates a Normalized Power and I've implemented the algorithm mentioned by FlowState (many thanks for sharing it with us). However, after the first real 2-hour ride, I noticed that my app calculated 1 Watt greater NP than the native Garmin 1030 datafield. Maybe it's just some rounding error, but I'd like to confirm whether I do all the things correctly:
Thanks
Check it on desktop, my algorithm shows decimals on desktop but not in mobile, I have reported this to garmin, otherwise convert to float
forums.garmin.com/.../decimals-in-summary
Values in the native datafield on the device, on mobile GC, and on desktop GC are consistent. Only the value in my custom datafield is 1 Watt higher. May it be that Garmin's native algorithm truncates the value instead of rounding?
So looks like that's the actual cause - Garmin doesn't much care about rounding integer values when formates them as a string.
I noticed the same behavior with temperature - value retrieved from Sensor.getInfo().temperature after rounding was often greater by 1° than the "native" value displayed on Edge 1030 top bar.
So I simplified my code for displaying NP value from
npString = "NP: " + Math.round(npFloat).format("%d");
npString = "NP: " + npFloat.format("%d");