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 H
2024-04-10 07:33:13 -07:00
committed by GitHub
parent d06faa2fcb
commit 95c24a50f7
2 changed files with 2 additions and 2 deletions

View File

@@ -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)
}