Relative Content

Tag Archive for angularngneat

Angular currency Mask how to input from right to left

import { createMask, InputmaskOptions } from “@ngneat/input-mask”; export const createCurrencyMask = (prefix: string = ‘MYR’): InputmaskOptions<string> => { const regex = new RegExp(`[${prefix},\s]`, ‘g’); return createMask({ alias: ‘numeric’, groupSeparator: ‘,’, digits: 2, digitsOptional: false, prefix: `${ prefix } `, placeholder: ‘0’, parser: (value: string) => Number(value.replace(regex, ”)) }); }; Hello there, i would like to […]

Angular currency Mask how to input from right to left

import { createMask, InputmaskOptions } from “@ngneat/input-mask”; export const createCurrencyMask = (prefix: string = ‘MYR’): InputmaskOptions<string> => { const regex = new RegExp(`[${prefix},\s]`, ‘g’); return createMask({ alias: ‘numeric’, groupSeparator: ‘,’, digits: 2, digitsOptional: false, prefix: `${ prefix } `, placeholder: ‘0’, parser: (value: string) => Number(value.replace(regex, ”)) }); }; Hello there, i would like to […]