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

Function difference

Script/TBPrice.js:143–150  ·  view source on GitHub ↗
(currentPrice, price)

Source from the content-addressed store, hash-verified

141}
142
143function difference(currentPrice, price) {
144 let difference = sub(currentPrice, price)
145 if (difference == 0) {
146 return "-"
147 } else {
148 return `${difference > 0 ? "↑" : "↓"}${String(difference)}`
149 }
150}
151
152function sub(arg1, arg2) {
153 return add(arg1, -Number(arg2), arguments[2]);

Callers 1

historySummaryFunction · 0.70

Calls 1

subFunction · 0.70

Tested by

no test coverage detected