HUF currency

Hi!

I'm using the NumericTextBox component. The currency is set to 'HUF' but the component shows $ (USD) always. The configuration is the following:

var numerictextbox = new ej.inputs.NumericTextBox({currency:'HUF',floatLabelType:'Always',format:'c',htmlAttributes:{"name":"HUF_FIELD"},locale:'hu',placeholder:'HUF field',step:Number(1),value:Number(1)});

Do I have to set or include something else?

Thank you!

3 Replies 1 reply marked as answer

PM Ponmani Murugaiyan Syncfusion Team April 19, 2021 11:19 AM UTC

Hi Kulcsár, 

Greetings from Syncfusion support. 

We have checked your reported query. The currency symbol for given currency will be obtained from the CLDR data. Therefore, we will need to load the CLDR data for that culture, as well as set the culture of the corresponding currency in the component's locale property.  To resolve the reported issue, please configure the culture in the application and ensure that the CLRD data is loaded. Please see the below code. 


/ To load culture files 
loadCultureFiles('hu'); 
 
var currency = new ej.inputs.NumericTextBox({ 
    locale: 'hu', 
    currency: 'HUF', 
    format: 'c2', 
    value: 100, 
}); 
currency.appendTo('#element'); 
 
  function loadCultureFiles(name) { 
      // To load the locale files 
        var files = ['currencies.json','numbers.json']; 
        var loader = ej.base.loadCldr; 
        var loadCulture = function (prop) { 
            var val, ajax; 
            ajax = new ej.base.Ajax('resources/cldr-data/main/' + name + '/' + files[prop], 'GET', false); 
            ajax.onSuccess = function (value) { 
                val = value; 
            }; 
            ajax.send(); 
            loader(JSON.parse(val)); 
        }; 
        for (var prop = 0; prop < files.length; prop++) { 
            loadCulture(prop); 
        } 
    } 

Output: 
 
 

Please find the sample from the below link.  
  

Note: You need to host the application in IIS to load the culture and currency of Numeric TextBox in Javascript. 

Please check the above sample and get back to us if you need further assistance. 

Regards, 
Ponmani M 


Marked as answer

KN Kulcsár Norbert April 21, 2021 05:39 PM UTC

Hi Ponmani!

Using the culture files from the sample solved the issue.

Thank you!


PM Ponmani Murugaiyan Syncfusion Team April 22, 2021 05:15 AM UTC

Hi Kulcsár, 

We are glad to know you that the reported issue is resolved in your end. We always happy to assist you.  

Regards, 
Ponmani M 


Loader.
Up arrow icon