View source Improve this doc

# `number`
filter in module `ng`

## Description

Formats a number as text.

If the input is not a number an empty string is returned.

## Usage

### In HTML Template Binding

`{{ number_expression | number[:fractionSize] }}`

### In JavaScript

`$filter('number')(number[, fractionSize])`

#### Parameters

Param | Type | Details
--- | --- | ---
number | number string | Number to format.
fractionSize (optional) | number string | Number of decimal places to round the number to. If this is not provided then the fraction size is computed from the current locale's number formatting pattern. In the case of the default locale, it will be 3.

#### Returns

string | Number rounded to decimalPlaces and places a “,” after each third digit.

## Example

#### Source

## Demo