dynobase-icon
Dynobase

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

Rafal Wilinski

Answered by Rafal Wilinski

Last updated: October 23rd, 2026

Solution

A numeric-conversion error containing NaN means the request contains a not-a-number value. Common JavaScript causes include arithmetic with undefined, parsing text that is not numeric, or converting an invalid date. DynamoDB does not store NaN or infinity as Numbers.

function parseAmount(raw) {
  if (typeof raw !== "string" || raw.trim() === "") {
    throw new TypeError("Amount must be nonempty numeric text");
  }
  const amount = Number(raw);
  if (!Number.isFinite(amount)) {
    throw new TypeError("Amount must be a finite number");
  }
  return amount;
}
const amount = parseAmount("12.50");
// Pass amount directly to DynamoDBDocumentClient, not { N: amount }.

Check nested maps and lists as well as top-level fields. Do not replace invalid input with zero unless zero is the intended business value. Optional missing data can be omitted or stored as NULL when the model allows it. For exact decimal amounts, preserve decimal text with an appropriate numeric representation; JavaScript Number can lose precision.

See number representations 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.