FormatNumeric
Table of Contents
Formats a number using a .NET numeric format string and returns the result as text.
String FormatNumeric(Numeric value, String format = 'N')
| Format | Description | Example (1234.567) |
| C | Currency | $1,234.57 |
| E | Exponential (scientific) | 1.23e+003 (E2) |
| F | Fixed-point | 1234.57 (F2) |
| G | General | 1234.567 |
| N | Number with thousands separators | 1,234.57 |
| P | Percent | 25.6% for 0.256 (P1) |
| Character | Description | Example (1234.567) |
| 0 | Zero placeholder | 00000.0 → 01234.6 |
| # | Digit placeholder | #.## → 1234.57 |
| . | Decimal point | 0.00 → 1234.57 |
| , | Thousands separator | #,{Function (0) does not have a defined descriptor.} → 1,235 |
| % | Percentage | 0% → 123457% |
Integer-only formats
Numbers are evaluated as decimals, so the integer-only formats D and X are rejected with "Format specifier was invalid".SELECT
FormatNumeric(1234.567) as Default,
FormatNumeric(1234.567, 'C') as Currency,
FormatNumeric(1234.567, 'F2') as Fixed,
FormatNumeric(1234.567, 'N1') as Number,
FormatNumeric(0.256, 'P1') as Percent,
FormatNumeric(1234.567, '#,##0.0') as Custom
FROM
SingleSQL :: IsEmpty
Returns true (1) if the given value is null or an empty string.
SQL :: IsEqual
Returns true (1) if the two given values are equal. The comparison is case-sensitive.
SQL :: IsGreater
Returns true (1) if the first value is greater than the second.
SQL :: IsGreaterOrEqual
Returns true (1) if the first value is greater than or equal to the second.
SQL :: IsInteger
Returns true (1) if the given value is a whole number, with an optional leading sign.
SQL :: IsLess
Returns true (1) if the first value is less than the second.
SQL :: IsLessOrEqual
Returns true (1) if the first value is less than or equal to the second.
SQL :: IsLike
Returns true (1) if the text matches the pattern. The pattern uses the same wildcards as Like: % matches any number of characters and _ matches a single character.
SQL :: IsNotBetween
Returns true (1) if the value is outside of the given range. The range boundaries are considered inside the range.
SQL :: IsNotEqual
Returns true (1) if the two given values are not equal. The comparison is case-sensitive.