I need to format amounts as per the pattern '##,###.00' in my application which uses oracle jet. As per the oracle jet documentation, it provides option style 'Currency' in built in number Converter and can be used as below,
var options= {
style: 'currency',
currency: 'EUR',
useGrouping: true,
currencyDisplay: 'code',
pattern:'#,###.## ¤'
}
let converter = oj.Validation.converterFactory("number").createConverter(options);
let value = converter.format("2323.343");
But, this will format amount based on the current locale value in
oj.config.getLocale()
So, if locale is set to any country where ',' is used as decimal separator, this converter will return something like 2.323,34 EUR. My requirement is to get same format for amount irrespective of the locale value. Oracle jet documentation says nothing about any option to override this. Anyway I can do this using oracle jet only ??
I have found out the option hidden on JSDoc page of oj IntlNumberConverter. Ojet provides an option called separators to specify decimal and grouping separators.