[🚀] 64KB
This commit is contained in:
		@@ -5,6 +5,7 @@ import (
 | 
				
			|||||||
	"bytes"
 | 
						"bytes"
 | 
				
			||||||
	"errors"
 | 
						"errors"
 | 
				
			||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
 | 
						"github.com/spf13/cast"
 | 
				
			||||||
	"io"
 | 
						"io"
 | 
				
			||||||
	"math"
 | 
						"math"
 | 
				
			||||||
	"math/rand"
 | 
						"math/rand"
 | 
				
			||||||
@@ -43,7 +44,7 @@ func ByteFmt(size int64) string {
 | 
				
			|||||||
	if frac > 0 {
 | 
						if frac > 0 {
 | 
				
			||||||
		return fmt.Sprintf("%.1f%s", math.Floor(val*10)/10, unitArr[p])
 | 
							return fmt.Sprintf("%.1f%s", math.Floor(val*10)/10, unitArr[p])
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		return fmt.Sprintf("%d%s", int(val), unitArr[p])
 | 
							return fmt.Sprintf("%d%s", cast.ToInt(val), unitArr[p])
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user