mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-11 09:07:18 +01: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:
parent
d06faa2fcb
commit
95c24a50f7
2 changed files with 2 additions and 2 deletions
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue