Skip to content

@serenity-is/corelib / formatNumber

Function: formatNumber()

formatNumber(num, format?, decOrLoc?, grp?): string

Formats a number using the current Culture locale (or the passed locale) settings. It supports format specifiers similar to .NET numeric formatting strings.

Parameters

num

number

the number to format

format?

string

the format specifier. default is 'g'. See .NET numeric formatting strings documentation for more information.

decOrLoc?

string | NumberFormat

grp?

string

Returns

string

Defined in

src/base/formatting.ts:269