Skip to content

Commit

Permalink
Fixed max value for decimal type
Browse files Browse the repository at this point in the history
  • Loading branch information
percona-csalguero committed Oct 14, 2019
1 parent 09944a2 commit b653add
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions internal/getters/decimal.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package getters

import (
"fmt"
"math"
"math/rand"
)

Expand All @@ -14,7 +13,11 @@ type RandomDecimal struct {
}

func (r *RandomDecimal) Value() interface{} {
f := rand.Float64() * float64(rand.Int63n(int64(math.Pow10(int(r.size)))))
size := r.size
if size > 10 {
size = 10
}
f := rand.Float64() * float64(rand.Int63n(int64(size)))
return f
}

Expand Down

0 comments on commit b653add

Please sign in to comment.