variable
variable

Reputation: 9684

Which format is appropriate to store a float value in AWS dynamodb table?

I want to store a float value (example: 10.12) in AWS dynamo db table.

The options available are:

enter image description here

To hold float value, should I choose string or number?

Upvotes: 7

Views: 4208

Answers (1)

Marc
Marc

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

Related Questions