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

Method reduce

java/lib/src/main/java/io/github/ccxt/base/Precise.java:150–172  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

148 }
149
150 public Precise reduce() {
151 String str = this.integer.toString();
152 int start = str.length() - 1;
153 if (start == 0) {
154 if (str.equals("0")) {
155 this.decimals = 0;
156 }
157 return this;
158 }
159 int i;
160 for (i = start; i >= 0; i--) {
161 if (str.charAt(i) != '0') {
162 break;
163 }
164 }
165 int difference = start - i;
166 if (difference == 0) {
167 return this;
168 }
169 this.decimals = toInt(this.decimals) - difference;
170 this.integer = new BigInteger(str.substring(0, i + 1));
171 return this;
172 }
173
174 public boolean equals(Precise other) {
175 this.reduce();

Callers 7

fetchDefaultMarketsMethod · 0.95
toEnMethod · 0.95
fromEnMethod · 0.95
fromPrecisionMethod · 0.95
fromEnMethod · 0.95
equalsMethod · 0.95
toStringMethod · 0.95

Calls 4

toIntMethod · 0.95
toStringMethod · 0.45
lengthMethod · 0.45
equalsMethod · 0.45

Tested by

no test coverage detected