VibeDict

🧩NaN shows up where a number should be

What you'll see
합계: NaN원

NaN means "Not a Number". It's the result of doing math with a value that isn't a number.

🤔 Why does it happen?

  • Input box values are text, so adding them as they are gives the wrong result
  • The math used an empty value (undefined)
  • Text with commas, like '1,000', was turned into a number

🔧 Try this

  1. Before doing math, turn values into numbers with Number(), and use 0 if that doesn't work
  2. Remove commas and units so only the number is left

🤖 Ask your AI like this

NaN shows up on screen instead of numbers. Please check the values that go into the math, turn them into numbers properly, and use 0 when a value is empty.

Replace the [ ] parts with your own situation, and paste the error with a few extra lines before and after it.

Related terms

Other errors in this group