# angular.formatter.number

Work in Progress This page is currently being revised. It might be incomplete or contain inaccuracies.

## Description

Use number formatter if you wish to convert the user entered string to a number.

## Usage

### In HTML Template Binding

    <input type="text" name="bindExpression" ng:format="number">

### In JavaScript

    var userInputString = angular.formatter.number.format(modelValue);
    var modelValue = angular.formatter.number.parse(userInputString);

### Returns

`{number}` –

Number from the parsed string.

## Example

     Enter valid number:
     <input type="text" name="value" ng:format="number" value="1234"/>
     <pre>value={{value}}</pre>

     it('should format numbers', function(){
       expect(binding('value')).toEqual('value=1234');
       input('value').enter('5678');
       expect(binding('value')).toEqual('value=5678');
     });