\r\n });\r\n \r\n im.mask(this.element);\r\n }\r\n}\r\n\r\nexport class CleanInputMaskValueConverter {\r\n fromView(val) {\r\n if (typeof val === 'string' && val.includes('
)) {\r\n \u002F\u002F Strip out $, _ and , as well as whitespace\r\n \u002F\u002F Then parse it as a floating number to account for decimals\r\n const parsedValue = parseFloat(val.replace('
, '').replace(\u002F_\u002Fg, '').replace(\u002F,\u002Fg, '').trim());\r\n\r\n \u002F\u002F The number is valid return it\r\n if (!isNaN(parsedValue)) {\r\n return parsedValue;\r\n }\r\n }\r\n\r\n \u002F\u002F Our parsed value was not a valid number, just return the passed in value\r\n return val;\r\n }\r\n}\r\n\r\nexport class PrecisionValueConverter {\r\n toView(val, prefix = null) {\r\n const parsedValue = parseFloat(val);\r\n\r\n if (!isNaN(parsedValue)) {\r\n if (prefix) {\r\n return `${prefix}${parsedValue.toFixed(2)}`;\r\n } else {\r\n return parsedValue.toFixed(2);\r\n }\r\n }\r\n\r\n return val;\r\n }\r\n}","id":"mod_PUUrPjJL6qrZYR6knTtzYG","is_binary":false,"title":"input-mask.ts","sha":null,"inserted_at":"2019-04-29T10:03:26","updated_at":"2019-04-29T10:04:02","upload_id":null,"shortid":"k8Byx","source_id":"src_9XkAmVDMcR71BRp7Rm1poL","directory_shortid":"GwjlJ"}],"is_sse":false,"inserted_at":"2019-04-29T10:00:37","always_on":false};