Skip to content

Support round(x, k) decimal precision#16

Open
milk-best-milk wants to merge 1 commit into
mainfrom
expr-round-precision
Open

Support round(x, k) decimal precision#16
milk-best-milk wants to merge 1 commit into
mainfrom
expr-round-precision

Conversation

@milk-best-milk

Copy link
Copy Markdown
Owner

round() gains an optional second argument: round(x) rounds to an integer (unchanged); round(x, 2) rounds to 2 decimals; negative k rounds to tens/hundreds. Backward compatible, unit-tested, isolated to src/core/expression.

round() now takes an optional second argument: round(x) rounds to an integer (unchanged), round(x, k) rounds to k decimal places (negative k rounds to tens/hundreds). Unit-tested.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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