Skip to content

Commit b653add

Browse files
Fixed max value for decimal type
1 parent 09944a2 commit b653add

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

internal/getters/decimal.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package getters
22

33
import (
44
"fmt"
5-
"math"
65
"math/rand"
76
)
87

@@ -14,7 +13,11 @@ type RandomDecimal struct {
1413
}
1514

1615
func (r *RandomDecimal) Value() interface{} {
17-
f := rand.Float64() * float64(rand.Int63n(int64(math.Pow10(int(r.size)))))
16+
size := r.size
17+
if size > 10 {
18+
size = 10
19+
}
20+
f := rand.Float64() * float64(rand.Int63n(int64(size)))
1821
return f
1922
}
2023

0 commit comments

Comments
 (0)