This is a migrated thread and some comments may be shown as answers.

Number Formatting

1 Answer 119 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mario
Top achievements
Rank 1
Mario asked on 08 Jan 2015, 02:44 PM
Hi

Unfortunately I find it overly complication to format something.

In my following example I have { field: "price", format: "{0:n5}" }

http://jsfiddle.net/Lqxon2f1/2/

How can I

1. apply both "n5" rule and "de-DE" formatting as described here: http://docs.telerik.com/kendo-ui/api/javascript/kendo#methods-toString

2. do a calculation with this data, ex. { field: "price", format: "{0} / 0.995 " } so that each value is divided by 0.995

Many thanks

1 Answer, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 12 Jan 2015, 08:55 AM
Hello Mario,

You should use column template to achieve this. Please define the column template as function, do the required data processing and return the result. For example:
{
 field: "age",
 template: function(data) { return kendo.toString(data.age / 0.995, "n5", "de-DE"); },
 footerTemplate: "Sum: #: sum #"
}

Please note that the corresponding culture file must be loaded when the Grid templates are rendered.

Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Mario
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or