Update RootView.mc

Memory usage decimal place was never used due to integer arithmetic. A single character changes fixed that.
This commit is contained in:
Philip Abbey
2024-01-21 13:00:31 +00:00
parent a5b2af81bc
commit 26954cbc60

View File

@ -139,7 +139,7 @@ class RootView extends ScalableView {
mMenuStatus.draw(dc); mMenuStatus.draw(dc);
mMemText.draw(dc); mMemText.draw(dc);
var stats = System.getSystemStats(); var stats = System.getSystemStats();
var memUsed = (100 * stats.usedMemory) / stats.totalMemory; var memUsed = (100f * stats.usedMemory) / stats.totalMemory;
mMemStatus.setText(memUsed.format("%.1f") + "%"); mMemStatus.setText(memUsed.format("%.1f") + "%");
if (stats.usedMemory > Globals.scLowMem * stats.totalMemory) { if (stats.usedMemory > Globals.scLowMem * stats.totalMemory) {
mMemStatus.setColor(Graphics.COLOR_RED); mMemStatus.setColor(Graphics.COLOR_RED);