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

Method toInt

java/lib/src/main/java/io/github/ccxt/base/Precise.java:323–328  ·  view source on GitHub ↗
(Object o)

Source from the content-addressed store, hash-verified

321
322 // -------- utilities --------
323 private static int toInt(Object o) {
324 if (o instanceof Integer) return (Integer) o;
325 if (o instanceof Long) return ((Long) o).intValue();
326 if (o instanceof String) return Integer.parseInt(((String) o).trim());
327 throw new IllegalArgumentException("Cannot convert to int: " + o);
328 }
329
330 private static String leftPad(String s, int size, char ch) {
331 if (s.length() >= size) return s;

Callers 8

PreciseMethod · 0.95
mulMethod · 0.95
divMethod · 0.95
addMethod · 0.95
modMethod · 0.95
orMethod · 0.95
reduceMethod · 0.95
toStringMethod · 0.95

Calls 1

parseIntMethod · 0.80

Tested by

no test coverage detected