Skip to content

Add fmt2 builtin: format number to N decimal places#170

Merged
danieljohnmorris merged 2 commits into
mainfrom
fix/fmt2-builtin
May 12, 2026
Merged

Add fmt2 builtin: format number to N decimal places#170
danieljohnmorris merged 2 commits into
mainfrom
fix/fmt2-builtin

Conversation

@danieljohnmorris
Copy link
Copy Markdown
Collaborator

prnt dumps full-precision floats; agents producing analysis reports had to manually massage every number. fmt2 x:n digits:n>t rounds half-to-even (Rust default) and clamps digits to 0-20. New opcode allocated above the math block. Cross-engine tests + example with a formatted percentile report.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

❌ Patch coverage is 95.65217% with 7 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/vm/mod.rs 91.35% 7 Missing ⚠️

📢 Thoughts on this report? Let us know!

@danieljohnmorris danieljohnmorris force-pushed the fix/fmt2-builtin branch 6 times, most recently from a2c4a85 to 3e87aa4 Compare May 12, 2026 00:12
new OP_FMT2 opcode wired through builtins, verifier, interpreter,
VM, and cranelift; tests + example covering the format.
@danieljohnmorris danieljohnmorris merged commit 9b3776d into main May 12, 2026
5 checks passed
@danieljohnmorris danieljohnmorris deleted the fix/fmt2-builtin branch May 12, 2026 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant