Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

ngx-number-format

MADCAZ1.9kMIT16.0.0TypeScript support: included

Simple number format for input element in Angular

angular, angular2, number-format, input-number, javascript

readme

ngx-number-format

Simple number format for input element in Angular

GitHub license

Table of contents

Versions

Angular ngx-number-format
>=14.0.0 <15.0.0 v14.x
>=13.0.0 <14.0.0 v13.x
>=12.0.0 <13.0.0 v12.x
>=11.0.0 <12.0.0 v11.x
>=10.0.0 <11.0.0 v3.x
>=6.0.0 <10.0.0 v2.x

Installation instructions

Install ngx-number-format from npm:

npm install ngx-number-format --save

Add needed package to NgModule imports:

import { NgxNumberFormatModule } from 'ngx-number-format';

@NgModule({
  ...
  imports: [NgxNumberFormatModule,...]
  ...
})

Add ngxNumberFormat to your input element:

<input type="text" ngxNumberFormat="#,###,###" />

Demo

demo project

API

Input | Type | Default | Required | Description | | ------------- | ------------- | ------------- | ------------- | ------------- | | [allowNegative] | boolean | false | no | Allows to negative numbers. |

changelog

16.0.0 (2023-06-13)

Features

  • core: support angular 16 (b93ac5a)

15.0.0 (2022-12-02)

Bug Fixes

  • bug: remove comma when decimal point more than three. (2d76ec5)

Features

  • core: support angular 15 (1c6fc77)

14.0.0 (2022-09-22)

Features

  • core: support angular 14 (2aab61f)

13.0.1 (2021-11-06)

Features

  • core: enable ivy in this project (777db0a)
  • core: support Angular 13 (71a3d7f)

12.0.0 (2021-06-22)

Features

  • core: Support Angular 12 (0ef4f35)

11.0.0 (2021-02-17)

Features

  • core: support Angular 11 (8be16be)

3.0.1 (2020-12-18)

Bug Fixes

  • bug: when reinit val with null dom not update (e05fb69)

3.0.0 (2020-10-06)

Features

  • core: support to Angular 10 (a525c17)

2.0.1 (2020-03-29)

Bug Fixes

  • core: fix package json support v 9.0 and 9.1 (c4f4b67)

2.0.0 (2020-02-07)

Features

  • core: support Angular 9 (4af9ff4)

1.2.0 (2019-11-07)

Features

  • core: support negative number (7dda536), closes #1
  • demo: update demo with negative number (2d5a9cf)
  • doc: update doc about negative number (64aca2e)

1.1.1 (2019-10-11)

Bug Fixes

  • bug: prevent comma character on keydown (b6cbdec)

Features

  • core: change value to zero when remove last number on numeric part (f2673dd)

1.1.0 (2019-10-09)

Bug Fixes

  • bug: update empty value to model when wrong pattern (995190b)
  • bug: wrong cursor position when zero value (48011c3)

Features

  • core: auto fill decimal on initial value (d87a799)
  • core: move cursor position when remove point (d519168)
  • core: move cursor to decimal part when selection on point (aad7f44)
  • core: replace 0 value when cursor at front (936ed0b)
  • core: replace decimal value when cursor on decimal part (16a4a85)

1.0.3 (2019-09-17)

Features

  • core: refactor code for all function (bc5fc99)

1.0.2 (2019-09-04)

Bug Fixes

  • core: not show 0 when initial value set to 0 (ffa7052)

1.0.1 (2019-09-03)

Bug Fixes

  • build: edit script readme (988a579)
  • core: fix initial value with type number (42466ed)

Features

  • core: support angular 6 7 or 8 (f002995)
  • demo: add section work with reactive forms (f07ec41)
  • demo: add version number on demo (870426b)

1.0.0-rc.1 (2019-08-09)