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

Method toDoubleOrNull

java/lib/src/main/java/io/github/ccxt/base/Generic.java:100–107  ·  view source on GitHub ↗
(Object o)

Source from the content-addressed store, hash-verified

98 }
99
100 private static Double toDoubleOrNull(Object o) {
101 if (o instanceof Number n) return n.doubleValue();
102 try {
103 return Double.parseDouble(String.valueOf(o));
104 } catch (NumberFormatException ignored) {
105 return null;
106 }
107 }
108
109 public static List<Object> sortBy2(Object array, Object key1, Object key2, Object desc2) {
110 boolean desc = (desc2 instanceof Boolean b) ? b : false;

Callers 1

compareJsLikeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected