Changed to smaller float

This commit is contained in:
Jonas Hahn
2025-09-18 21:15:56 +02:00
parent 4168e92601
commit 15e71a1348
4 changed files with 31 additions and 30 deletions

View File

@@ -28,9 +28,9 @@ func NameFromEmail(email string) string {
return ""
}
func RoundFloat(val float64, precision uint) float64 {
ratio := math.Pow(10, float64(precision))
return math.Round(val*ratio) / ratio
func RoundFloat(val float32, precision uint) float32 {
ratio := math.Pow(10, float64(precision))
return float32(math.Round(float64(val)*ratio) / ratio)
}
func MustRandToken(n int) string {