This repository was archived by the owner on Oct 30, 2023. It is now read-only.
Commit 185a012
Jon Eyrick
Add roundTicks function to fix PRICE_FILTER errors
Usage: binance.roundTicks(price, tickSize)
```js
function roundTicks(number, tickSize) {
const formatter = new Intl.NumberFormat('en-US', { style: 'decimal', minimumFractionDigits: 0, maximumFractionDigits: 8 });
const precision = formatter.format(tickSize).split('.')[1].length || 0;
if ( typeof number === 'string' ) number = parseFloat(number);
return number.toFixed(precision);
}
```1 parent 3a3b73e commit 185a012
1 file changed
Lines changed: 15 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
814 | 814 | | |
815 | 815 | | |
816 | 816 | | |
817 | | - | |
818 | | - | |
| 817 | + | |
| 818 | + | |
819 | 819 | | |
820 | 820 | | |
821 | 821 | | |
822 | 822 | | |
823 | 823 | | |
824 | 824 | | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
825 | 838 | | |
826 | 839 | | |
827 | 840 | | |
| |||
0 commit comments