Skip to content

An Angular pipe module for interfacing the Awesome Numeraljs library.

License

Notifications You must be signed in to change notification settings

jogboms/ngx-numeral

Folders and files

NameName
Last commit message
Last commit date

Latest commit

6051116 Β· Jan 22, 2022

History

24 Commits
Jan 22, 2022
Jan 21, 2022
Dec 30, 2017
Dec 30, 2017
Dec 30, 2017
Dec 10, 2017
Dec 31, 2017
Jan 22, 2022
Dec 30, 2017
Dec 30, 2017

Repository files navigation

ngx-numeral

npm version npm Build Status Coverage Status

An Angular pipe module for interfacing the Awesome Numeraljs library.

Installation

npm i -S ngx-numeral

Usage

Add NumeralModule to your application module.

@NgModule({
 declarations: [
   AppComponent
 ],
 imports: [
   NumeralModule.forRoot()
   // ...
 ],
 bootstrap: [AppComponent]
})

export class AppModule { }

Use Pipe within your template file

<h1>{{ '12345.123' | numeral:'$0,0.00' }}</h1>

Or instatiate NumeralPipe in your components with the desired value.

import { NumeralPipe } from 'ngx-numeral';

class ExampleComponent implements OnInit {
  formatted_string: string;

  ngOnInit() {
    const numeral = new NumeralPipe('7784.374');
    this.formatted_string = numeral.format('$0,0.00');
  }
}

A demo application is also included.

About

An Angular pipe module for interfacing the Awesome Numeraljs library.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published