fix: fixed different percentage rounding in the Disk popup and widget (#2560)

This commit is contained in:
Serhiy Mytrovtsiy
2025-08-26 18:26:08 +02:00
parent f9bcf5a6e9
commit 37701ac9da
2 changed files with 2 additions and 2 deletions

View File

@@ -70,7 +70,7 @@ public struct DiskWidget: Widget {
GeometryReader { geometry in
if let anchor = chartProxy.plotFrame {
let frame = geometry[anchor]
Text("\(Int((100*(value.size-value.free))/value.size))%")
Text("\(Int(value.percentage.rounded(toPlaces: 2) * 100))%")
.font(.system(size: 16, weight: .regular))
.position(x: frame.midX, y: frame.midY-5)
Text("Disk")