MCPcopy Index your code
hub / github.com/simstudioai/sim / toRoman

Function toRoman

apps/sim/lib/pptx-renderer/renderer/text-renderer.ts:455–467  ·  view source on GitHub ↗
(num: number)

Source from the content-addressed store, hash-verified

453}
454
455function toRoman(num: number): string {
456 const vals = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1]
457 const syms = ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I']
458 let result = ''
459 let remaining = num
460 for (let i = 0; i < vals.length; i++) {
461 while (remaining >= vals[i]) {
462 result += syms[i]
463 remaining -= vals[i]
464 }
465 }
466 return result
467}
468
469// ---------------------------------------------------------------------------
470// Main Render Function

Callers 1

generateAutoNumberFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected