INVALID_TYPE, Expected type number but found type string after using number_format()

Hi I have an issue with number_format() in PHP .
Anyway to fix:

[code] => INVALID_TYPE
[message] => Expected type number but found type string

When placing a order, After using :

$rate = number_format("$rate", 8, '.', '');

For a pair with a low price like SHIB/USDT If I don’t use number_format, I’m getting a price of 3.0E-5 after adding a percentage to it , and getting this error:

    [message] => Access denied: Access Denied: Invalid API Signature

(error that I understand and is legit) I need to use number_format to get : 0.00003000 instead of 3.0E-5, but when I’m doing it in this way, I got the message :

 [code] => INVALID_TYPE
 [message] => Expected type number but found type string

I tried to do

$rate = +"$rate";

after number format to convert the type string into type number, but it turn back the price to 3.0E-5 .
So if you have any suggestion, thanks you very much .

Maybe a quick fix will be to allow “type string” like others exchange (don’t have any problem with Binance, Bittrex or Kucoin) .

You can not currently send string numbers and the format of that has to be number.

Unfortunately smaller decimal points (beyond 7 decimal points) start getting converted to scientific number which is quite confusing and causes some issues.

A solution we are looking at is to allow string numbers in future to avoid this issue all along but thats not available at the moment.

1 Like

Ok, Hope that’s it will be implemented soon because I just integrated the exchange on my bot and saw this error after …
So my customers are not able to use the exchange properly .

This should be an issue only when you get into 7 decimal points and more. You should not convert numbers to string regardless.