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

Format phone number in cell

1 Answer 451 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jonathan
Top achievements
Rank 1
Jonathan asked on 29 Jun 2012, 10:11 PM
Hi I'm trying to format a 10 digit phone number via the template property in the column definition.  The following does not work, but shows what I am after:

{
field: "phone",
title: "Phone Number",
template: '#= kendo.toString(phone,"(###) ###-####") #'
}

Any suggestions.  I also tried escaping the hash symbols with \\, but that did not help. 

Thanks in advance,

Jonathan

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 03 Jul 2012, 07:53 AM
Hello Jonathan,

 
As I pointed in the other forum thread, the kendo.toString method is not intended to format numbers using custom numeric formats, which have groups of numbers. You will need to use custom method which do this.

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