System.getSystemStats().battery -> XX.0000 instead of XX.XXXX on newer generation watches (enduro3, fenix8, fr965)

Can anyone give me a hint why this code does not work as intended on newer devices?

var myStats = System.getSystemStats();
var battraw = myStats.battery.toFloat();
var batt = 0.0; // battery percent
batt = Lang.format( "$1$%", [ battraw.format( "%2.4f" ) ] );
System.println("Batt: " + batt);

Output Fenix 8 simulator: 
Batt: 43.4567%

Output Fenix 8 real device: 
Batt: 43.0000%

Output Fenix 7 simulator: 
Batt: 43.4567%

Output Fenix 7 real device: 
Batt: 43.4567%

Only 1 per cent accuracy on the Fenix 8 - full accuracy on the Fenix 7 - Why?

  • Your post is interesting, but off-topic - this thread is about the precision of ‘battery’ and not ‘batteryInDays’.
    Imho it would make sense not to mix up the topics and to open a new thread on the subject of batteryInDays. This will ensure that the title and content match.

    My question has already been answered by jim_m_58 and flocsy - the precision of the ‘battery’ value depends on the hardware and is not the same for all watches. Plus: The simulator sometimes shows a different behaviour than the real device.

  • You asked - Can you please explain in more detail what you mean?

    I answered - but I agree

  • I revisited this (thanks to FlowState to reminding this thread out to me). I found why a developer would want to see the battery percentage in precision higher than whole numbers :) 

    For future reference: I tested my datafield and app that use the same view, and more or less differ in that the app has a 1 second timer that calls the callculate and onUpdate. And there's a use case, where the user pauses the activity. Obviously during the time it's paused (technically it's stopped) there are no records in the fit file, and I'd like to be able to see the slight but "sudden" decrease of the battery indicating the battery drop not by the datafield (during the time it was on pause and the watch face was displayed) - of course the same is not possible with the app, but even there I now decreased the timer to once per minute, so the time gets updated, but the unnecessary calculations are not done 59 times a minute.