NumericFormat

Controls the way in which numbers are displayed.

Syntax

NumericFormat(inputNumber, formatSpecifier, reqDecimalPlaces, customFormat)

Enabled For

For a description of the business object categories, see Notes on "Enabled For".

Business Object Category Yes/No
Business Rules: Before-Save Rules Yes
Business Rules: Calculation Rules (After Save, with or without Also Recalculate on Load) Yes1
Business Rules: Calculation Rules (Before Save or Always, without Also Recalculate On Load) Yes
Business Rules: Calculation Rules (Before Save or Always, with Recalculate On Load) Yes1
Business Rules: Editing Rules Yes
Business Rules: Initialization Rules Yes
Business Rules: Read Only Rules Yes
Business Rules: Required Rules Yes
Business Rules: Validation Rules Yes
Client Expressions Yes
Object Permissions No
Services No
LDAP No
Mobile No
Quick Actions (except UI Quick Actions) Yes
UI Quick Actions Yes
Reports Yes
Search/Dashboard without field references No
Search/Dashboard with field references No

1. Not fully supported in calculation rules that have a condition of After Save or the Also Recalculate on Load option selected. It may fail if the rule's field is used in a grid, form, or saved search.

Parameters

Parameter Description
inputNumber Input value to Format (Number value)

formatSpecifier

Format to apply

reqDecimalPlaces

(Optional) Number of decimal places. Default value is 2.

customFormat

(Optional) Custom Format

Return Value

Returns a string form of a given number.

Examples

$(NumericFormat(123, 'CUSTOM', 2, '00000'))

Returns this value:

00123

$(NumericFormat("98765.4321", "CUSTOM", 2, "##-##-##"))

Returns this value:

9-87-65

$(NumericFormat("98765.43210", "NUMBER"))

Returns this value:

98,765.43

formatSpecifier

The table below shows the supported options along with an example of each.

Format

Example Input

Example Output
NUMBER

$(NumericFormat(12345.67890, "NUMBER", 1 ))

12,345.7

GENERAL

$(NumericFormat(12345.67890, "GENERAL" ))

12345.6789

CURRENCY

$(NumericFormat(12345.67890, "CURRENCY", 3 ))

$12,345.678

FIXEDPOINT

$(NumericFormat(12345.67890, "FIXED POINT", 3 ))

12345.679

PERCENT

$(NumericFormat(12345.67890, "PERCENT" ))

1,234,567.89%

SCIENTIFIC

$(NumericFormat(12345.67890, "SCIENTIFIC" ))

1.234568E+ 004

HEXADECIMAL

$(NumericFormat(43981, "HEXADECIMAL" ))

ABCD

CUSTOM

$(NumericFormat(98765.4321, "CUSTOM", 2, "##-##-##"))

9-87-65

Requires knowledge of the legal .NET numeric formats. For example, F3 would return 12345.679. See the Microsoft Documentation for more information.