Enhancement: allow specifying default currency for Monetary custom field (#7381)

This commit is contained in:
shamoon
2024-08-05 17:02:03 -07:00
committed by GitHub
parent 0ee85aae21
commit 15554322dd
13 changed files with 168 additions and 29 deletions

View File

@@ -90,7 +90,9 @@ export class CustomFieldDisplayComponent implements OnInit, OnDestroy {
)?.value
if (this.value && this.field.data_type === CustomFieldDataType.Monetary) {
this.currency =
this.value.match(/([A-Z]{3})/)?.[0] ?? this.defaultCurrencyCode
this.value.match(/([A-Z]{3})/)?.[0] ??
this.field.extra_data?.default_currency ??
this.defaultCurrencyCode
this.value = parseFloat(this.value.replace(this.currency, ''))
} else if (
this.value?.length &&