Skip to content

Commit ee3a23f

Browse files
authored
Merge pull request #826 from apernet/wip-fix-bpsconv
fix: bps conv (should be 1000 not 1024)
2 parents cccb955 + 6d6a26b commit ee3a23f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

app/internal/utils/bpsconv.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ import (
88
)
99

1010
const (
11-
Byte = 1.0 << (10 * iota)
12-
Kilobyte
13-
Megabyte
14-
Gigabyte
15-
Terabyte
11+
Byte = 1
12+
Kilobyte = Byte * 1000
13+
Megabyte = Kilobyte * 1000
14+
Gigabyte = Megabyte * 1000
15+
Terabyte = Gigabyte * 1000
1616
)
1717

1818
// StringToBps converts a string to a bandwidth value in bytes per second.

0 commit comments

Comments
 (0)