Default currency

#1

Hello,

Is there a way to change the default currency format?
Indeed, it formats the value as US currency ($X,XXX), but we need it to format as europe currency (X XXX€)

Examples where this format is used :

"field" : {
    "component" : "field.Currency",
    "name" : "projectCost.value"
} 

{
   expression: "aggregate(BilledSpendElectricityTotal, 'SUM') + aggregate(BilledSpendThermalEnergyTotal, 'SUM')",
   divId: "ElectricCost",
   format: C3.script.helpers.currency,
}

{
            "label": "{~Enterprise.ProjectsListView.Capex~}",
            "field": "projectCost.value",
            "align": "left",
            "sortable": true,
            "format": "currency"
}
0 Likes

#2

At this time, no. The “currency” helper function is making use of third-party Globalize, but not in such a way currently as to expose the ability to set a locale for the formatting. This feature is in the roadmap for future framework enhancements.

As a work-around for this, additional helper functions can be added into /content/js/customCode folder of an application’s folder if you create a .js file with the following structure:

(function() {
    var helpers = C3.script.helpers;
    _.extend(helpers, {
       
        sampleNewHelper: function(sampleValue) {
            // Logic goes here to reshape sampleValue
           return sampleValue;    
        }

    });
})();
0 Likes