We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Template number formatting

Thread ID:

Created:

Updated:

Platform:

Replies:

128265 Jan 11,2017 08:55 AM Jan 13,2017 04:15 AM JavaScript 3
loading
Tags: ejMap
Paul
Asked On January 11, 2017 08:55 AM

I'm using this example. How can I format float number values in ejMap template (2 digits after coma etc)?

Dharanidharan Dharmasivam [Syncfusion]
Replied On January 12, 2017 08:12 AM

Hi Paul, 
 
Thanks for using Syncfusion product. 
 
We have analyzed your query and prepared a sample with respect to your requirement. In this we have used ej.format method which will format the number with the specified precision. If the precision value is 2, then two digits will be shown after the decimal. Kindly find the code snippet below, 
 
JS: 
 
$.views.helpers({ 
            parseDouble: function (amount) { 
                  amount = parseInt(amount);                 
                                               amount= ej.format(amount,"n2"); 
                return amount; 
            } 
        }); 
 
 
Screenshot: 
 
 
For your reference we have attached the sample. Kindly find the sample from below link, 
 
Thanks, 
Dharani. 
 
 


Paul
Replied On January 12, 2017 09:19 AM

Works perfect
Thanks!

Anandaraj T [Syncfusion]
Replied On January 13, 2017 04:15 AM

  
Hi Paul, 

Most welcome. 

Please let us know if you have any other queries regarding this. We are glad to assist you. 

Regards, 
Anand 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;