MCPcopy Create free account
hub / github.com/cursor/plugins / parseFiniteNumber

Function parseFiniteNumber

orchestrate/skills/orchestrate/scripts/measurements.ts:214–221  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

212}
213
214function parseFiniteNumber(value: string): number | null {
215 // Used for the `measuredNumeric` display field: lenient leading-numeric
216 // strip, separate from the end-anchored unit-aware comparison.
217 const match = /^[-+]?\d+(?:\.\d+)?/.exec(value.trim());
218 if (!match) return null;
219 const parsed = Number.parseFloat(match[0]);
220 return Number.isFinite(parsed) ? parsed : null;
221}
222
223function formatFraction(value: number): string {
224 return `${(value * 100).toFixed(1)}%`;

Callers 1

compareMeasurementFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected