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

Method toFixed

java/lib/src/main/java/io/github/ccxt/Exchange.java:3419–3424  ·  view source on GitHub ↗
(Object number, Object decimals)

Source from the content-addressed store, hash-verified

3417 }
3418
3419 public Object toFixed(Object number, Object decimals) {
3420 double num = ((Number) number).doubleValue();
3421 int dec = ((Number) decimals).intValue();
3422 double factor = Math.pow(10, dec);
3423 return Math.round(num * factor) / factor;
3424 }
3425
3426 public static Object getProperty(Object obj, Object property, Object defaultValue) {
3427 if (obj == null || property == null) {

Callers

nothing calls this directly

Calls 2

powMethod · 0.45
roundMethod · 0.45

Tested by

no test coverage detected