Update frontend regex

This commit is contained in:
shamoon 2024-04-10 07:04:07 -07:00
parent c0f13293f7
commit 5ca731bc8b

View File

@ -51,7 +51,7 @@ export class MonetaryComponent extends AbstractInputComponent<string> {
get monetaryValue(): string { get monetaryValue(): string {
if (!this.value) return null if (!this.value) return null
const focused = document.activeElement === this.inputField?.nativeElement const focused = document.activeElement === this.inputField?.nativeElement
const val = parseFloat(this.value.toString().replace(/[^0-9.,]+/g, '')) const val = parseFloat(this.value.toString().replace(/[^0-9.,-]+/g, ''))
return focused ? val.toString() : val.toFixed(2) return focused ? val.toString() : val.toFixed(2)
} }