Skip to content

Commit ccb2b98

Browse files
committed
fix hash rate formatter
whoops!!!!
1 parent 062a0d9 commit ccb2b98

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

miner-app/lib/src/utils/hashrate_formatter.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
class 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
}

0 commit comments

Comments
 (0)