MCPcopy
hub / github.com/ccxt/ccxt / toInt

Method toInt

java/lib/src/main/java/io/github/ccxt/Helpers.java:881–889  ·  view source on GitHub ↗
(Object o)

Source from the content-addressed store, hash-verified

879 }
880
881 private static int toInt(Object o) {
882 if (o instanceof Integer) return (Integer) o;
883 if (o instanceof Long) return ((Long) o).intValue();
884 if (o instanceof Double) return ((Double) o).intValue();
885 if (o instanceof Float) return ((Float) o).intValue();
886 if (o instanceof BigDecimal) return ((BigDecimal) o).intValue();
887 if (o instanceof String) return Integer.parseInt((String) o);
888 return Integer.parseInt(String.valueOf(o));
889 }
890
891 private static double toDouble(Object o) {
892 if (o instanceof Double) return (Double) o;

Callers 8

GetValueMethod · 0.95
toFixedMethod · 0.95
SliceMethod · 0.95
addElementToObjectMethod · 0.95
padEndMethod · 0.95
padStartMethod · 0.95
index.cjsFile · 0.45
index.cjsFile · 0.45

Calls 1

parseIntMethod · 0.80

Tested by

no test coverage detected