Reputation: 9684
I want to store a float value (example: 10.12) in AWS dynamo db table.
The options available are:
To hold float value, should I choose string or number?
Upvotes: 7
Views: 4208
Reputation: 2410
Long pending issue but DynamoDB apparently does not support float straight out-of-the-box.
That said, storing it as string
is the consensus work-around.
For reference, please refer to this answer from the official AWS Boto3 GitHub page, here.
What worked for us is wrapping the floating point value into str and casting to Decimal, no loss of precision!
Upvotes: 10