I'm using an api from a third party and one of the data fields I need to send in the body is a float with 8 decimals places, it cant be a string, but when I send the body the number is sent as a exponential value like 8.9e-7, is there a way to send it as a float?
JSON.stringify({float:0.00000078})
"{"float":7.8e-7}"
with toFixed(8) returns a string.
API example
fetch("api-url", {
method: "POST",
headers: {
"Content-type": "application/json"
},
body: JSON.stringify({ float: 0.00000078 })
})