File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11class HashrateFormatter {
22 static String format (double hashrate) {
3- if (hashrate >= 10E12 ) {
4- return '${(hashrate / 10E12 ).toStringAsFixed (2 )} TH/s' ;
5- } else if (hashrate >= 10E9 ) {
6- return '${(hashrate / 10E9 ).toStringAsFixed (2 )} GH/s' ;
7- } else if (hashrate >= 10E6 ) {
8- return '${(hashrate / 10E6 ).toStringAsFixed (2 )} MH/s' ;
9- } else if (hashrate >= 10E3 ) {
10- return '${(hashrate / 10E3 ).toStringAsFixed (2 )} KH/s' ;
3+ if (hashrate >= 1E12 ) {
4+ return '${(hashrate / 1E12 ).toStringAsFixed (2 )} TH/s' ;
5+ } else if (hashrate >= 1E9 ) {
6+ return '${(hashrate / 1E9 ).toStringAsFixed (2 )} GH/s' ;
7+ } else if (hashrate >= 1E6 ) {
8+ return '${(hashrate / 1E6 ).toStringAsFixed (2 )} MH/s' ;
9+ } else if (hashrate >= 1E3 ) {
10+ return '${(hashrate / 1E3 ).toStringAsFixed (2 )} KH/s' ;
1111 } else {
1212 return '${hashrate .toStringAsFixed (2 )} H/s' ;
1313 }
You can’t perform that action at this time.
0 commit comments