(num, threshold)
| 286 | function roundLargeNumbers(num, threshold) { |
| 287 | // If the absolute value of the number is greater than or equal to threshold, round to the nearest integer |
| 288 | if (Math.abs(num) >= threshold) { |
| 289 | return Math.round(num); |
| 290 | } else { |
| 291 | return num.toFixed(2); |
| 292 | } |
| 293 | } |
| 294 | |
| 295 | return new Promise((resolve, reject) => { |
| 296 | fs.readFile("./deploy/v2/lightsources.json", "utf8", (err, data) => { |
| 297 | if (err) { |
| 298 | console.error(err); |