(precision: Str)
| 7569 | } |
| 7570 | |
| 7571 | integerPrecisionToAmount (precision: Str) { |
| 7572 | /** |
| 7573 | * @ignore |
| 7574 | * @method |
| 7575 | * @description handles positive & negative numbers too. parsePrecision() does not handle negative numbers, but this method handles |
| 7576 | * @param {string} precision The number of digits to the right of the decimal |
| 7577 | * @returns {string} a string number equal to 1e-precision |
| 7578 | */ |
| 7579 | if (precision === undefined) { |
| 7580 | return undefined; |
| 7581 | } |
| 7582 | if (Precise.stringGe (precision, '0')) { |
| 7583 | return this.parsePrecision (precision); |
| 7584 | } else { |
| 7585 | const positivePrecisionString = Precise.stringAbs (precision); |
| 7586 | const positivePrecision = parseInt (positivePrecisionString); |
| 7587 | let parsedPrecision = '1'; |
| 7588 | for (let i = 0; i < positivePrecision - 1; i++) { |
| 7589 | parsedPrecision = parsedPrecision + '0'; |
| 7590 | } |
| 7591 | return parsedPrecision + '0'; |
| 7592 | } |
| 7593 | } |
| 7594 | |
| 7595 | async loadTimeDifference (params = {}) { |
| 7596 | const serverTime = await this.fetchTime (params); |
no test coverage detected