mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-11 16:22:26 +08:00
fix: remove scientific notation in DecimalBytes
This commit is contained in:
@@ -20,6 +20,12 @@ func TestDecimalBytes(t *testing.T) {
|
||||
assert.Equal("3.123PB", DecimalBytes(float64(3.123*UnitPB)))
|
||||
assert.Equal("4.123EB", DecimalBytes(float64(4.123*UnitEB)))
|
||||
assert.Equal("1EB", DecimalBytes(float64(1000*UnitPB)))
|
||||
|
||||
assert.Equal("62MB", DecimalBytes(61812496, 0))
|
||||
assert.Equal("61.8MB", DecimalBytes(61812496, 1))
|
||||
assert.Equal("401MB", DecimalBytes(401000000))
|
||||
assert.Equal("401MB", DecimalBytes(401000000, 0))
|
||||
assert.Equal("4MB", DecimalBytes(4010000, 0))
|
||||
}
|
||||
|
||||
func TestBinaryBytes(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user