question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

priceToPrecision returns String

See original GitHub issue

Function 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:closed
  • Created 6 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Pmantcommented, Jan 2, 2018

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.

0reactions
kroitorcommented, Jan 2, 2018

@Pmant

If it is actually intended the way it is you can close this issue.

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found