Skip to content

Add ROUND function#749

Merged
MarkMpn merged 4 commits into
MarkMpn:masterfrom
sulimanbenhalim:add-round-function
Apr 19, 2026
Merged

Add ROUND function#749
MarkMpn merged 4 commits into
MarkMpn:masterfrom
sulimanbenhalim:add-round-function

Conversation

@sulimanbenhalim

Copy link
Copy Markdown
Contributor

Adds the ROUND function which returns a numeric value rounded to the specified length or precision.

Changes

  • ExpressionFunctions.cs — eight overloads covering all supported numeric types: int, bigint, smallint, tinyint, decimal, float, real, money
  • FunctionMetadata.cs — autocomplete/IntelliSense entry
  • ExpressionFunctionTests.cs — unit tests for float, int, and bigint overloads covering positive/negative lengths, truncation mode, and null inputs

Usage

SELECT ROUND(123.9995, 3)    -- 124.000
SELECT ROUND(748.58, -1)     -- 750.00
SELECT ROUND(150.75, 0, 1)   -- 150.00  (truncate)
SELECT ROUND(amount, 2)      -- works on any numeric column

@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

1 similar comment
@sonarqubecloud

Copy link
Copy Markdown

@MarkMpn MarkMpn merged commit b8cad1f into MarkMpn:master Apr 19, 2026
2 checks passed
@sulimanbenhalim sulimanbenhalim deleted the add-round-function branch April 22, 2026 21:24
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.

2 participants