priceToPrecision returns String
See original GitHub issueFunction priceToPrecision returns String-Type, should be Float.
- OS: Windows 10
- Programming Language: Node.js 8.9.3
- CCXT version: 1.1.544
- Exchange: Bittrex (all?)
- Method: priceToPrecision
const ccxt = require ('ccxt');
const bittrex = new ccxt.bittrex({});
(async () => {
await bittrex.loadMarkets();
console.log(typeof bittrex.priceToPrecision('DGB/BTC', 0.00000509))
})();
output: ‘string’
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Exchanges — ccxt 2.4.71 documentation
name : This is a string literal containing the human-readable exchange name. ... It returns an associative array of markets indexed by trading...
Read more >TypeScript ccxt Exchange.priceToPrecision Examples
priceToPrecision extracted from open source projects. ... public priceToPrecision(symbol: string, amount: number) { return Number(this.exchangeConnection.
Read more >How to use amountToPrecision ccxt library - Stack Overflow
I used this, passing amount and price on the signature of the createOrder method: let formattedAmount = binance.amountToPrecision(symbol ...
Read more >builtins.String.toPrecision JavaScript and Node.js code examples ...
try { return 1.0.toPrecision(undefined) === '1'; ... How to use. toPrecision. function. in. String. Best JavaScript code snippets using builtins.String.
Read more >Transforming data on fetch | Rest Hooks
function deeplyApplyKeyTransform(obj: any, transform: (key: string) => string) { ... return deeplyApplyKeyTransform(jsonResponse, camelCase);
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes that’s what I’m doing in my code, I just suggested it would be more intuitive if the values returned by priceToPrecision und amountToPrecision had the same type. If it is actually intended the way it is you can close this issue.
@Pmant
Currently, it is, but we are going to make it more convenient very soon. We are working on a much better support for arbitrary precision: https://github.com/ccxt/ccxt/issues/522. Will keep you updated on our progress. Thx!