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

@@ -52,6 +52,11 @@ describe('MonetaryComponent', () => {
expect(component.defaultCurrencyCode).toEqual('BRL')
})
it('should support setting a default currency code', () => {
component.defaultCurrency = 'EUR'
expect(component.defaultCurrencyCode).toEqual('EUR')
})
it('should parse monetary value correctly', () => {
expect(component['parseMonetaryValue']('123.4')).toEqual('123.4')
expect(component['parseMonetaryValue']('123.4', true)).toEqual('123.40')