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 88
88
name: " IBD" ; when: ! synced && ! paused && connected
89
89
PropertyChanges {
90
90
target: root
91
- header: Math . round (nodeModel .verificationProgress * 100 ) + " % "
91
+ header: formatProgressPercentage (nodeModel .verificationProgress * 100 )
92
92
subText: formatRemainingSyncTime (nodeModel .remainingSyncTime )
93
93
}
94
94
},
@@ -139,6 +139,18 @@ Item {
139
139
}
140
140
]
141
141
142
+ function formatProgressPercentage (progress ) {
143
+ if (progress >= 1 ) {
144
+ return Math .round (progress) + " %"
145
+ } else if (progress >= 0.1 ) {
146
+ return progress .toFixed (1 ) + " %"
147
+ } else if (progress >= 0.01 ) {
148
+ return progress .toFixed (2 ) + " %"
149
+ } else {
150
+ return " 0%"
151
+ }
152
+ }
153
+
142
154
function formatRemainingSyncTime (milliseconds ) {
143
155
var minutes = Math .floor (milliseconds / 60000 );
144
156
var seconds = Math .floor ((milliseconds % 60000 ) / 1000 );
You can’t perform that action at this time.
0 commit comments