mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-10-17 21:38:12 +00:00
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:
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)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user