MCPcopy Create free account
hub / github.com/Moli-X/Resources / add

Function add

Script/TBPrice.js:156–164  ·  view source on GitHub ↗
(arg1, arg2)

Source from the content-addressed store, hash-verified

154}
155
156function add(arg1, arg2) {
157 arg1 = arg1.toString(), arg2 = arg2.toString();
158 var arg1Arr = arg1.split("."), arg2Arr = arg2.split("."), d1 = arg1Arr.length == 2 ? arg1Arr[1] : "", d2 = arg2Arr.length == 2 ? arg2Arr[1] : "";
159 var maxLen = Math.max(d1.length, d2.length);
160 var m = Math.pow(10, maxLen);
161 var result = Number(((arg1 * m + arg2 * m) / m).toFixed(maxLen));
162 var d = arguments[2];
163 return typeof d === "number" ? Number((result).toFixed(d)) : result;
164}
165
166function requestPrice(share_url, callback) {
167 const options = {

Callers 1

subFunction · 0.70

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected