Skip to content

Commit

Permalink
Merge pull request #18730 from samgermain/probit-string-math
Browse files Browse the repository at this point in the history
probit.createOrder string math
  • Loading branch information
kroitor committed Aug 1, 2023
2 parents d57284e + 6ff6f5a commit 2c713c6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ts/src/probit.ts
Expand Up @@ -1236,7 +1236,9 @@ export default class probit extends Exchange {
if (createMarketBuyOrderRequiresPrice) {
if (price !== undefined) {
if (cost === undefined) {
cost = amount * price;
const amountString = this.numberToString (amount);
const priceString = this.numberToString (price);
cost = this.parseNumber (Precise.stringMul (amountString, priceString));
}
} else if (cost === undefined) {
throw new InvalidOrder (this.id + " createOrder() requires the price argument for market buy orders to calculate total order cost (amount to spend), where cost = amount * price. Supply a price argument to createOrder() call if you want the cost to be calculated for you from price and amount, or, alternatively, add .options['createMarketBuyOrderRequiresPrice'] = false and supply the total cost value in the 'amount' argument or in the 'cost' extra parameter (the exchange-specific behaviour)");
Expand Down

0 comments on commit 2c713c6

Please sign in to comment.