Angular forms formatCurrency Directive Last Updated : 02 Jun, 2021 Summarize Comments Improve Suggest changes Share Like Article Like Report In this article, we are going to see what is formatCurrency in Angular 10 and how to use it. The formatCurrency is used to format a number as currency using locale rules. Syntax: formatCurrency(value, locale, currency, currencyCode, digitsInfo) Parameters: value: The number to format.locale: A locale code for the locale format.currency: A string containing the currency symbol or its name.currencyCode: the currency code.digitsInfo: Decimal representation options. Return Value: string: the formatted currency code. NgModule: Module used by formatCurrency is: CommonModule Approach: Create the Angular app to be used.In app.module.ts import LOCALE_ID because we need locale to be imported for using get formatCurrency.import { LOCALE_ID, NgModule } from '@angular/core';In app.component.ts import formatCurrency and LOCALE_IDinject LOCALE_ID as a public variable.In app.component.html show the local variable using string interpolationServe the angular app using ng serve to see the output. Example 1: app.component.ts import { formatCurrency } from '@angular/common'; import {Component, Inject, LOCALE_ID } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html' }) export class AppComponent { curr = formatCurrency(10,this.locale, 'USD'); constructor( @Inject(LOCALE_ID) public locale: string,){} } app.component.html <h1> GeeksforGeeks </h1> <p>Locale Currency is : {{curr}}</p> Output: Example 2: app.component.ts import { formatCurrency } from '@angular/common'; import {Component, Inject, LOCALE_ID } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html' }) export class AppComponent { curr = formatCurrency(10,this.locale, 'INR'); constructor( @Inject(LOCALE_ID) public locale: string,){} } app.component.html <h1> GeeksforGeeks </h1> <p>Locale Currency is : {{curr}}</p> Output: Reference: https://angular.io/api/common/formatCurrency Comment More infoAdvertise with us Next Article Angular forms formatCurrency Directive T taran910 Follow Improve Article Tags : Web Technologies AngularJS AngularJS-Directives Angular10 Similar Reads AngularJS ng-value Directive The ng-value Directive in AngularJS is used to specify the value of an input element. This directive can be used to achieve the one-way binding for the given expression to an input element, especially when the ng-model directive is not used for that specific element. It is supported by <input> 2 min read AngularJS ng-style Directive The ng-style Directive in AngularJS is used to apply custom CSS styles on an HTML element. The expression inside the ng-style directive must be an object. It is supported by all the HTML elements. Syntax: <element ng-style="expression"> Content ... </element>Parameter: expression: It rep 2 min read Angular10 NgPluralCase Directive In this article, we are going to see what is NgPluralCase in Angular 10 and how to use it. The NgPluralCase in Angular10 is used to create a view that will be added or removed from the parent NgPlural when the given expression matches the plural expression. We can use the values to make the output p 1 min read Angular 7 | Directives Directives in Angular 7 are Typescript class which is declared with decorator @Directive. These are the Document Object Model (DOM) instruction sets, which decide how logic implementation can be done.Angular directives can be classified into three types:Â Â Component Directives: It forms the main cla 2 min read Angular 10 NgTemplateOutlet Directive In this article, we are going to see what is NgTemplateOutlet in Angular 10 and how to use it. The NgTemplateOutlet in Angular10 is used to insert an embedded view from a prepared TemplateRef. NgTemplateOutlet adds the reference element which is displayed on the page. Syntax: <li *NgTemplateOutle 1 min read Like