2021-12-13 10:53:49 +08:00
|
|
|
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
|
|
|
|
|
|
|
|
|
|
package numberutils
|
|
|
|
|
|
|
|
|
|
import "testing"
|
|
|
|
|
|
|
|
|
|
func TestFormatBytes(t *testing.T) {
|
|
|
|
|
t.Log(FormatBytes(1))
|
|
|
|
|
t.Log(FormatBytes(1000))
|
|
|
|
|
t.Log(FormatBytes(1_000_000))
|
|
|
|
|
t.Log(FormatBytes(1_000_000_000))
|
|
|
|
|
t.Log(FormatBytes(1_000_000_000_000))
|
|
|
|
|
t.Log(FormatBytes(1_000_000_000_000_000))
|
|
|
|
|
t.Log(FormatBytes(1_000_000_000_000_000_000))
|
|
|
|
|
t.Log(FormatBytes(9_000_000_000_000_000_000))
|
|
|
|
|
}
|
2022-01-03 12:04:09 +08:00
|
|
|
|
|
|
|
|
func TestFormatCount(t *testing.T) {
|
|
|
|
|
t.Log(FormatCount(1))
|
|
|
|
|
t.Log(FormatCount(1000))
|
|
|
|
|
t.Log(FormatCount(1500))
|
|
|
|
|
t.Log(FormatCount(1_000_000))
|
|
|
|
|
t.Log(FormatCount(1_500_000))
|
|
|
|
|
t.Log(FormatCount(1_000_000_000))
|
|
|
|
|
t.Log(FormatCount(1_500_000_000))
|
|
|
|
|
}
|