n8n · MySQL node
Decimal numbers returned as strings
The n8n MySQL node returns DECIMAL values as strings by default to avoid losing precision. Turn on the Output Decimals as Numbers option to get JavaScript numbers, but leave it off for money, identifiers and values you compare or store again.
VerifiedLast verified
01Error text
Decimal numbers returned as strings02Likely causes
- By default the MySQL node returns DECIMAL values, and NUMERIC as its alias, as strings to avoid precision loss.
03How to fix it
- Turn on the Output Decimals as Numbers option to convert them to JavaScript numbers. Values beyond about 15 significant digits are rounded without warning.
- Leave the option off for money, identifiers and values that are compared or stored again.
- Or convert the values after the node with
toFloat()andtoFixed(), or with an Edit Fields (Set) node. Precision loss can still occur.
04Fix it with AI
Copy this prompt into Claude Code, ChatGPT or any AI assistant. It already holds the error, the likely causes and the fix steps, so the assistant starts from what is known instead of guessing.
I'm getting this error in n8n (MySQL node):
Decimal numbers returned as strings
What it usually means: The n8n MySQL node returns DECIMAL values as strings by default to avoid losing precision. Turn on the Output Decimals as Numbers option to get JavaScript numbers, but leave it off for money, identifiers and values you compare or store again.
Likely causes:
- By default the MySQL node returns DECIMAL values, and NUMERIC as its alias, as strings to avoid precision loss.
Fix steps that usually work:
1. Turn on the Output Decimals as Numbers option to convert them to JavaScript numbers. Values beyond about 15 significant digits are rounded without warning.
2. Leave the option off for money, identifiers and values that are compared or stored again.
3. Or convert the values after the node with toFloat() and toFixed(), or with an Edit Fields (Set) node. Precision loss can still occur.
Help me fix it. If you can read my project files, find where this error comes from. If not, ask me for what you need (the failing step, its input, the connection or config). Check the likely causes one by one, tell me which one it is and why, then give me the exact change to make. Do not change anything in production. Reference: https://ipaaserrors.com/n8n/mysql-decimal-numbers-returned-as-stringsNothing is sent anywhere from this page. Read what the assistant suggests before you apply it.
iNotes
The docs describe this as a problem and do not quote a fixed error message, so the text above is the docs' own heading.
05Official documentation
→Related errors
- Can't connect to a local MySQL server when using DockerWhen n8n cannot connect to a local MySQL server with Docker involved, the Host in the MySQL credential or the network setup does not match where MySQL and n8n run. MySQL must listen on 0.0.0.0, and the Host must be localhost, host.docker.internal or the MySQL container name depending on the setup.
- A 'json' property isn't an objectThis n8n Code node error occurs when the node returns data where the json key does not point to an object. Make sure that the json key references an object in your return data.
Test every fix in a non-production environment before you apply it to production. See how entries are verified.
More for n8n work:Open n8n jobsn8n pay estimates