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

Function difference

Script/JD/JdPrice.js:138–145  ·  view source on GitHub ↗
(currentPrice, price)

Source from the content-addressed store, hash-verified

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

Callers 1

historySummaryFunction · 0.70

Calls 1

subFunction · 0.70

Tested by

no test coverage detected