Very Odd Issues with HTTP Request and Doubles/Floats

I’m having a major issues with n8n. I’m making a HTTP request to the API, the API expect a double but n8n keep sending it an INT, even when hardcoded to a double.

This only happens when the double is a zero value, for example, 66.00, however, 66.01 works without issues.

This issue is not API related as I’ve tried on SwaggerHub and with Insomnia and it works with a zero double (66.00 for example). The issues purely occurs with n8n.

this is the my http request

Its this line that is cause the issue “amount”: {{ $(‘Supabase2’).item.json.payableGross.toFixed(2) }},

It results in “amount”: 66.00,

However, I get this error: “400 - “{"error":{"errors":[{"type":-1,"msg":"Value type mismatch for amount. (Was expecting double, but received type: integer, value: 66)","errors":}],"code":400,"message":"Invalid request"}}””

this is the output of the HTTP request that is causing the error:

{
  "property": {
    "id": 1692
  },
  "description": "Leak under the sink was fixed with a new pipe.",
  "date": {
    "date": "2024-08-30 10:10:15",
    "timezone": "Europe/London"
  },
    "amount": 66.00,
  "expense_category": 1,
  "contractor": {
  "id": 268,
  "reference": "IS15174131 - IS15174131"
}
}

Can anyone help please!?

this is it working in insomnia:

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

It appears that no matter what I do, n8n always removes the .00 when it is a zero sum, is there a way to override this?

Would be good if someone at n8n could look into this, I’ve had to create a cloud function for the HTTP request to call as n8n just will not allow a .00 through it’s json validation.

Hi @Wayne

Sorry for the late reply!
I was able to reproduce the issue and will make an internal ticket to get that looked at :eyes:

Will post here for an update!

Thanks :pray:

2 Likes