DynamoDBNumberError on trying to insert floating point number using python boto library
Use Decimal(str(your_number)) instead. See https://github.com/boto/boto3/issues/665
Yes There are Known issues on GitHub related to floating numbers, There may be 2 workarounds , First if you are comfortable to store 10.5
instead of 10.55
, then it will just work fine I guess, The another is to store the floating value as String or integer and later modulate it while accessing.
So of you chose the string part then you could store it as '10.55'
instead of 10.55
and later when you access the values from the table then you could simply use float("10.55")
and you will be done.
Another method is to store it as an integer , First choose a precision value (say 2 decimal values) then you will store 10.55
as 1055
(multiplied by 100, since 2 decimal precision), and while accessing it you could have simply used 1055/100.0
and you will get 10.55
.