Skip to content

Commit

Permalink
fix: parse float
Browse files Browse the repository at this point in the history
  • Loading branch information
zakuwaki committed Jun 22, 2023
1 parent e949d34 commit eae6ae5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions experimental/limiter/bandwidth.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ func (bw *Bandwidth) Parse(s string) (err error) {
default:
return E.New("invalid bandwidth value: ", s)
}
cnt, err := strconv.ParseUint(cstr, 10, 64)
cnt, err := strconv.ParseFloat(cstr, 64)
if err != nil {
return
}
bw.s = s
bw.i = cnt * unit
bw.i = uint64(cnt * float64(unit))
return
}

0 comments on commit eae6ae5

Please sign in to comment.