Skip to content

Commit

Permalink
fixed loses precision for large values aws#186
Browse files Browse the repository at this point in the history
  • Loading branch information
joeke80215 committed Aug 29, 2019
1 parent ec56cb7 commit 1ee63f4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions events/attributevalue.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ func (av DynamoDBAttributeValue) Number() string {
// of an int64 of the appropriate sign.
// Method panics if the attribute is not of type Number.
func (av DynamoDBAttributeValue) Integer() (int64, error) {
s, err := strconv.ParseFloat(av.Number(), 64)
return int64(s), err
return strconv.ParseInt(av.Number(), 10, 64)
}

// Float provides access to an attribute of type Number.
Expand Down

0 comments on commit 1ee63f4

Please sign in to comment.