Skip to content

mahiwaykos/currencyPipe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Angular 5: How to use Currency Pipe inside the input to get formatted currency

Founded the efficient way to use the default currency pipe provided by the angular to format the currecncy while user is typing the value inside the input.

I had used the Indian currency (INR) in the code. You just need to change currency as per the requirement and also need to update the currency symbol inside the conditions.

For Example we will use for USD:

change INR to USD

   this.formattedAmount = this.currencyPipe.transform(this.value, 'USD', true, '1.0-0');     

also need to update "₹" sign with the currency symbol in our case replace with "$"

  if (element.target.value.indexOf('$') !== -1) {
          this.formattedAmount = this.formattedAmount.replace(/[$,]/g, "")

About

Using Currency Pipe inside input Angular 5

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy