2018-02-19 15:25:02 +08:00
|
|
|
package utils
|
|
|
|
|
|
|
|
import (
|
|
|
|
"math"
|
|
|
|
)
|
|
|
|
|
2018-02-23 15:58:48 +08:00
|
|
|
func BytesToKB(b uint64) float64 {
|
|
|
|
return float64(b) / math.Pow10(3)
|
2018-02-19 15:25:02 +08:00
|
|
|
}
|
|
|
|
|
2018-02-23 15:58:48 +08:00
|
|
|
func BytesToMB(b uint64) float64 {
|
|
|
|
return float64(b) / math.Pow10(6)
|
2018-02-19 15:25:02 +08:00
|
|
|
}
|
|
|
|
|
2018-02-23 15:58:48 +08:00
|
|
|
func BytesToGB(b uint64) float64 {
|
|
|
|
return float64(b) / math.Pow10(9)
|
2018-02-19 15:25:02 +08:00
|
|
|
}
|