Fix: Allow negative monetary values with a current code (#6358)

* Updates the currency validation to allow an optional negative

* Update frontend regex

---------

Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
This commit is contained in:
Trenton Handshamoon authored and GitHub committed 2024-04-10 07:33:13 -07:00
1 parent d06faa2fcb
commit 95c24a50f7
2 files changed
+2 -2

No files matched your search

@@ -51,7 +51,7 @@ export class MonetaryComponent extends AbstractInputComponent<string> {
get monetaryValue(): string {
if (!this.value) return null
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)
}