Skip to content

Add ABS function#744

Merged
MarkMpn merged 7 commits into
MarkMpn:masterfrom
sulimanbenhalim:add-abs-function
Mar 14, 2026
Merged

Add ABS function#744
MarkMpn merged 7 commits into
MarkMpn:masterfrom
sulimanbenhalim:add-abs-function

Conversation

@sulimanbenhalim

Copy link
Copy Markdown
Contributor

Adds the ABS function which returns the absolute (positive) value of a numeric expression.

Changes

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

Usage

SELECT ABS(-42)         -- 42
SELECT ABS(-3.14)       -- 3.14
SELECT ABS(amount)      -- works on any numeric column

@sonarqubecloud

Copy link
Copy Markdown

@MarkMpn MarkMpn merged commit 032fe25 into MarkMpn:master Mar 14, 2026
2 checks passed
@sulimanbenhalim sulimanbenhalim deleted the add-abs-function branch March 16, 2026 12:36
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