devextreme
Version:
HTML5 JavaScript Component Suite for Responsive Web Development
32 lines (31 loc) • 1.14 kB
JavaScript
/**
* DevExtreme (cjs/__internal/core/localization/currency.js)
* Version: 25.2.3
* Build date: Fri Dec 12 2025
*
* Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _default = exports.default = {
_formatNumberCore(value, format, formatConfig) {
if ("currency" === format) {
formatConfig.precision = formatConfig.precision ?? 0;
let result = this.format(value, Object.assign({}, formatConfig, {
type: "fixedpoint"
}));
const currencyPart = this.getCurrencySymbol().symbol.replace(/\$/g, "$$$$");
result = result.replace(/^(\D*)(\d.*)/, `$1${currencyPart}$2`);
return result
}
return this.callBase.apply(this, [value, format, formatConfig])
},
getCurrencySymbol: () => ({
symbol: "$"
}),
getOpenXmlCurrencyFormat: () => "$#,##0{0}_);\\($#,##0{0}\\)"
};