MCPcopy Index your code
hub / github.com/ccxt/ccxt / parseToNumeric

Method parseToNumeric

java/lib/src/main/java/io/github/ccxt/Exchange.java:5624–5636  ·  view source on GitHub ↗
(Object number)

Source from the content-addressed store, hash-verified

5622 }
5623
5624 public Object parseToNumeric(Object number)
5625 {
5626 Object stringVersion = this.numberToString(number); // this will convert 1.0 and 1 to "1" and 1.1 to "1.1"
5627 // keep this in mind:
5628 // in JS: 1 === 1.0 is true
5629 // in Python: 1 == 1.0 is true
5630 // in PHP: 1 == 1.0 is true, but 1 === 1.0 is false.
5631 if (Helpers.isTrue(Helpers.isGreaterThanOrEqual(Helpers.getIndexOf(stringVersion, "."), 0)))
5632 {
5633 return Helpers.parseFloat(stringVersion);
5634 }
5635 return Helpers.parseInt(stringVersion);
5636 }
5637
5638 public Object isRoundNumber(Object value)
5639 {

Callers 15

isRoundNumberMethod · 0.95
testDeepExtendMethod · 0.95
createOrderRequestMethod · 0.45
cancelTwapOrderMethod · 0.45
cancelOrdersRequestMethod · 0.45
fetchOrderMethod · 0.45
cancelOrdersMethod · 0.45
setMarginMethod · 0.45
fetchOrderMethod · 0.45

Calls 6

numberToStringMethod · 0.95
isTrueMethod · 0.95
isGreaterThanOrEqualMethod · 0.95
getIndexOfMethod · 0.95
parseFloatMethod · 0.95
parseIntMethod · 0.95

Tested by 4

testDeepExtendMethod · 0.76