Skip to content

Commit

Permalink
fix(graph): right handle gpu memory in percent
Browse files Browse the repository at this point in the history
  • Loading branch information
orblazer committed May 5, 2023
1 parent af61440 commit ec10b8b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package/contents/ui/components/graph/GpuGraph.qml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ RMBaseGraph.TwoSensorsGraph {
for (let i = 0; i < sensorsModel.sensors.length; i++) {
let value = sensorsModel.getInfo(i);
if (i === 1 && plasmoid.configuration.gpuMemoryInPercent) {
value = value / uplimits[1];
value = (value / maxQueryModel.maxMemory) * 100;
}
root._insertChartData(i, value);

Expand All @@ -50,7 +50,7 @@ RMBaseGraph.TwoSensorsGraph {
}
_formatValue: (index, data) => {
if (index === 1 && plasmoid.configuration.gpuMemoryInPercent) {
return i18nc("Percent unit", "%1%", Math.round((data.value / uplimits[1]) * 100) / 100);
return i18nc("Percent unit", "%1%", Math.round((data.value / maxQueryModel.maxMemory) * 1000) / 10); // This is for round to 1 decimal
}
return _defaultFormatValue(index, data);
}
Expand Down

0 comments on commit ec10b8b

Please sign in to comment.