MCPcopy Create free account
hub / github.com/AntonPalmqvist/physically-based-api / roundLargeNumbers

Function roundLargeNumbers

scripts/create-usd.mjs:288–295  ·  view source on GitHub ↗
(num, threshold)

Source from the content-addressed store, hash-verified

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);

Callers 1

makeUSDFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected