MCPcopy
hub / github.com/di-sukharev/opencommit / floatSafeRemainder

Function floatSafeRemainder

out/cli.cjs:30371–30378  ·  view source on GitHub ↗
(val, step)

Source from the content-addressed store, hash-verified

30369 });
30370 };
30371 function floatSafeRemainder(val, step) {
30372 const valDecCount = (val.toString().split(".")[1] || "").length;
30373 const stepDecCount = (step.toString().split(".")[1] || "").length;
30374 const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
30375 const valInt = parseInt(val.toFixed(decCount).replace(".", ""));
30376 const stepInt = parseInt(step.toFixed(decCount).replace(".", ""));
30377 return valInt % stepInt / Math.pow(10, decCount);
30378 }
30379 var ZodNumber = class _ZodNumber extends ZodType {
30380 constructor() {
30381 super(...arguments);

Callers 1

_parseMethod · 0.85

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…