dynobase-icon
Dynobase

Error: dynamodb the parameter cannot be converted to a numeric value

Rafal Wilinski

Answered by Rafal Wilinski

Last updated: October 23rd, 2026

Solution

“The parameter cannot be converted to a numeric value” means a value supplied as DynamoDB Number is not valid numeric text or is outside DynamoDB’s supported precision and range. Decimal fractions are supported. The correct representation depends on whether you use a low-level or document API.

  • Low-level API: use {"N":"12.5"}. The string is the wire representation of a Number; {"S":"12.5"} stores a String instead.
  • JavaScript document client: pass a finite native number, such as 12.5, not an AttributeValue wrapper. Validate user input before coercion.
  • Boto3 Table resource: use Decimal("12.5") for fractional values. Python floats are rejected by boto3’s DynamoDB serializer.
  • Reject empty input, NaN, infinity, booleans used as numbers, and formatted strings such as currency amounts or comma-separated digits.
from decimal import Decimal
import boto3

amount = Decimal("12.50")
if not amount.is_finite():
    raise ValueError("Amount must be finite")
table = boto3.resource("dynamodb", region_name="us-east-1").Table("Orders")
table.put_item(Item={"pk": "ORDER#123", "sk": "DETAIL", "amount": amount})

DynamoDB supports up to 38 digits of numeric precision. Avoid converting exact decimal strings through a binary floating-point value first, which can lose precision before DynamoDB sees the data. If a key is defined as Number, changing its request value to String will cause a key-type mismatch rather than fix the numeric input.

See DynamoDB data types and AWS documentation.

Dynobase is a Professional GUI Client for DynamoDB

Start your 7-day free trial today

Product Features

Download
/
Pricing
/
Member Portal
/
Privacy
/
EULA
/
Twitter
© 2026 Dynobase
+
Still using AWS DynamoDB Console?
Try Dynobase to accelerate your DynamoDB workflow. Start your 7-day free trial today.