Technical Info
>
Framework Considerations: Angular
>
Angular Directives for Formatting Input
Begin by importing the JhaResponsiveCoreModule into your application.
Import the JhaResponsiveCoreModule module
// import into app.module
import{JhaResponsiveCoreModule}from'@jkhy/responsive-ui-angular/jha-responsive-core';@NgModule({imports:[...JhaResponsiveCoreModule.forRoot(),...]})exportclassAppModule(){}
jhaCurrencyInput
Add the jhaCurrencyInput directive to inputs that prompt for currency. This directive formats the input’s value as currency after the user exits the field. Non-currency characters are removed from the value and the decimal portion is padded to 2 places.
Add the jhaDecimalInput attribute directive to inputs that prompt for numeric values, where you need a specific number of decimal places shown after the decimal point; use the jhaDecimalPlaces attribute to specify the number of decimal places. The value is formatted after the user exits the field.
Add the jhaZeroPaddedNumber attribute directive to inputs that prompt for numeric values, where the value must be padded with zeros to a specified length; use the jhaLength attribute to specify the total number of digits that must be present. The value is formatted after the user exits the field.