MCPcopy
hub / github.com/ccxt/ccxt / add

Method add

java/lib/src/main/java/io/github/ccxt/Helpers.java:361–376  ·  view source on GitHub ↗
(Object a, Object b)

Source from the content-addressed store, hash-verified

359 }
360
361 public static Object add(Object a, Object b) {
362 a = normalizeIntIfNeeded(a);
363 b = normalizeIntIfNeeded(b);
364
365 if (a instanceof Long && b instanceof Long) {
366 return ((Long) a) + ((Long) b);
367 } else if (a instanceof Double || b instanceof Double) {
368 return toDouble(a) + toDouble(b);
369 } else if (a instanceof String && b instanceof String) {
370 return ((String) a) + ((String) b);
371 } else if (a instanceof String || b instanceof String) {
372 return String.valueOf(a) + String.valueOf(b);
373 }
374
375 return null;
376 }
377
378 public static String add(String a, String b) {
379 return a + b;

Callers 15

handleDeltaMethod · 0.95
checkProxyUrlSettingsMethod · 0.95
checkProxySettingsMethod · 0.95
checkWsProxySettingsMethod · 0.95
checkAddressMethod · 0.95
setSandboxModeMethod · 0.95
enableDemoTradingMethod · 0.95
fetchAccountsMethod · 0.95
fetchTradesMethod · 0.95
fetchTradesWsMethod · 0.95
watchLiquidationsMethod · 0.95

Calls 2

normalizeIntIfNeededMethod · 0.95
toDoubleMethod · 0.95

Tested by 15

addMethod · 0.76
AssertDeepEqualMethod · 0.76
testFetchOrderBooksMethod · 0.76
testTickerMethod · 0.76
testFetchOHLCVMethod · 0.76
testMarketMethod · 0.76
testFetchPositionsMethod · 0.76
testFetchLiquidationsMethod · 0.76
testFetchTradingFeeMethod · 0.76
testOHLCVMethod · 0.76
testLiquidationMethod · 0.76