As Per DynamoDB Documentation : Datatypes :
String
Strings are Unicode with UTF-8 binary encoding. The length of a string
must be greater than zero, and is constrained by the maximum DynamoDB
item size limit of 400 KB.
If you define a primary key attribute as a string type attribute, the
following additional constraints apply:
- For a simple primary key, the maximum length of the first attribute value (the partition key) is 2048 bytes.
- For a composite primary key, the maximum length of the second attribute value (the sort key) is 1024 bytes.
Number
Numbers can be positive, negative, or zero. Numbers can have up to 38
digits precision—exceeding this will result in an exception.
- Positive range: 1E-130 to 9.9999999999999999999999999999999999999E+125
- Negative range: -9.9999999999999999999999999999999999999E+125 to -1E-130
In DynamoDB, numbers are represented as variable length. Leading and
trailing zeroes are trimmed.
All numbers are sent across the network to DynamoDB as strings, to
maximize compatibility across languages and libraries. However,
DynamoDB treats them as number type attributes for mathematical
operations.
Note : If number precision is important, you should pass numbers to DynamoDB using strings that you convert from number type.
I Hope, this may help you get your answer.