summaryrefslogtreecommitdiffstats
path: root/utils/utils.go
blob: 684a87bc58b852f3a167c44cb59fe3bda8417f20 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package utils

import (
	"math"
)

func BytesToKB(b int) int {
	return int((float64(b) / math.Pow10(3)))
}

func BytesToMB(b int) int {
	return int((float64(b) / math.Pow10(6)))
}

func BytesToGB(b int) int {
	return int((float64(b) / math.Pow10(9)))
}