File tree 1 file changed +13
-1
lines changed
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 93
93
name: " IBD" ; when: ! synced && ! paused && connected
94
94
PropertyChanges {
95
95
target: root
96
- header: Math . round (nodeModel .verificationProgress * 100 ) + " % "
96
+ header: formatProgressPercentage (nodeModel .verificationProgress * 100 )
97
97
subText: formatRemainingSyncTime (nodeModel .remainingSyncTime )
98
98
}
99
99
},
@@ -144,6 +144,18 @@ Item {
144
144
}
145
145
]
146
146
147
+ function formatProgressPercentage (progress ) {
148
+ if (progress >= 1 ) {
149
+ return Math .round (progress) + " %"
150
+ } else if (progress >= 0.1 ) {
151
+ return progress .toFixed (1 ) + " %"
152
+ } else if (progress >= 0.01 ) {
153
+ return progress .toFixed (2 ) + " %"
154
+ } else {
155
+ return " 0%"
156
+ }
157
+ }
158
+
147
159
function formatRemainingSyncTime (milliseconds ) {
148
160
var minutes = Math .floor (milliseconds / 60000 );
149
161
var seconds = Math .floor ((milliseconds % 60000 ) / 1000 );
You can’t perform that action at this time.
0 commit comments