mirror of
https://github.com/dutchcoders/transfer.sh.git
synced 2024-11-30 08:00:19 +01:00
gofmt
This commit is contained in:
parent
3ea4ffd0e3
commit
3990c3c5b7
2 changed files with 10 additions and 11 deletions
|
@ -258,9 +258,9 @@ func acceptsHTML(hdr http.Header) bool {
|
|||
|
||||
func formatSize(size int64) string {
|
||||
sizeFloat := float64(size)
|
||||
base := math.Log(sizeFloat)/math.Log(1024)
|
||||
base := math.Log(sizeFloat) / math.Log(1024)
|
||||
|
||||
sizeOn := math.Pow(1024, base - math.Floor(base))
|
||||
sizeOn := math.Pow(1024, base-math.Floor(base))
|
||||
|
||||
var round float64
|
||||
pow := math.Pow(10, float64(2))
|
||||
|
@ -276,7 +276,6 @@ func formatSize(size int64) string {
|
|||
suffixes[3] = "GB"
|
||||
suffixes[4] = "TB"
|
||||
|
||||
|
||||
getSuffix := suffixes[int(math.Floor(base))]
|
||||
return fmt.Sprintf("%s %s", strconv.FormatFloat(newVal, 'f', -1, 64), getSuffix)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue