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

Method toDoubleSafe

java/lib/src/main/java/io/github/ccxt/Exchange.java:511–523  ·  view source on GitHub ↗
(Object val, double defaultValue)

Source from the content-addressed store, hash-verified

509 }
510
511 private double toDoubleSafe(Object val, double defaultValue) {
512 if (val == null) {
513 return defaultValue;
514 }
515 if (val instanceof Number) {
516 return ((Number) val).doubleValue();
517 }
518 try {
519 return Double.parseDouble(val.toString());
520 } catch (Exception e) {
521 return defaultValue;
522 }
523 }
524 // --- getters / setters to emulate C# auto-properties ---
525 public Object getWssProxy() {
526 return wssProxy;

Callers 1

transformApiNewMethod · 0.95

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected