@ngodings/ngx-rupiah
v15.0.9
Published
Angular directive mask for currency Rupiah/IDR support for NgModule or Reactive forms, pipe for currency Rupiah/IDR & pipe for terbilang in Rupiah/IDR
Downloads
78
Maintainers
Readme
@ngodings/ngx-rupiah
Angular directive mask for currency Rupiah/IDR support for NgModule or Reactive forms, pipe for currency Rupiah/IDR & pipe for terbilang in Rupiah/IDR
Demo - Angular v15
https://npm.ngodings.com/packages/ngx-rupiah
Support Me
If you like this package I will be happy that you support me on Buy me a coffee :) Buy me coffee: https://www.buymeacoffee.com/alidihaw Indonesia People: https://sociabuzz.com/dihaw
Getting Started
Installing and Importing
Install the package by command:
npm install @ngodings/ngx-rupiah --save
Import the module
import { NgxRupiahModule } from "@ngodings/ngx-rupiah";
@NgModule({
imports: [
...
NgxRupiahModule
],
declarations: [...],
providers: [...]
})
export class AppModule {}
Usage
<input rupiahMask formControlName="value" />
ngModel
An attribute of type number. If is displayed'Rp 5000'
, the attribute will be'5000'
.
Terbilang Function
- 1250000 = Satu Juta Dua Ratus Lima Puluh Ribu Rupiah
- 25000000 = Dua Puluh Lima Juta Rupiah
- 5000 = Lima Ribu Rupiah
this.rupiahService.getTerbilang(1250000);
this.rupiahService.getTerbilang(25000000);
this.rupiahService.getTerbilang(5000);
Import the service
constructor(private rupiahService: RupiahService,) {}
Terbilang Pipe
- 1250000 = Satu Juta Dua Ratus Lima Puluh Ribu Rupiah
- 25000000 = Dua Puluh Lima Juta Rupiah
- 5000 = Lima Ribu Rupiah
{{ 1250000 | terbilangPipe }}
{{ 25000000 | terbilangPipe }}
{{ 5000 | terbilangPipe }}
Rupiah Pipe
- 1250000 = Rp1.250.000,00
- 25000000 = Rp25.000.000,00
- 5000 = Rp5.000,00
{{ 1250000 | rupiahPipe }}
{{ 25000000 | rupiahPipe }}
{{ 5000 | rupiahPipe }}
Development
Prepare your environment
- Install Node.js and NPM
- Install local dev dependencies:
npm install
while current directory is this repo
License
MIT @ Ali Abdul Wahid