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

kendo.format trailing zeroes for decimal number formatting

4 Answers 172 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Boris Gheihman
Top achievements
Rank 1
Boris Gheihman asked on 02 Mar 2015, 09:21 AM
I'm getting strange results for kendo.format:
kendo.format('{0:0.##%}', 0.035) // 3.50%
kendo.format('{0:0.##%}', 0.045) // 4.5%

It's very unexpected behavior. I could reproduce it on latest version of kendo, here is a dojo.

4 Answers, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 04 Mar 2015, 07:31 AM
Hi Boris,

you should escape the percentage sign, like our documentation states.

Regards,
Petyo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Boris Gheihman
Top achievements
Rank 1
answered on 04 Mar 2015, 10:48 AM
I'm sorry Petyo, I didn't specify the exact issue. I want it to be transformed and rendered as percentage actually. I'm just not sure why I have trailing zero in first example. I think it should be rendered as "3.5%" not as "3.50%". What do you think?
0
Petyo
Telerik team
answered on 06 Mar 2015, 08:28 AM
Hi Boris,

sorry for the misunderstanding. After some further investigation, this turned out to be a bug in our implementation - I am logging it for a fix here.

Regards,
Petyo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Boris Gheihman
Top achievements
Rank 1
answered on 06 Mar 2015, 10:28 AM
Thanks, Petyo!
Tags
General Discussions
Asked by
Boris Gheihman
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Boris Gheihman
Top achievements
Rank 1
Share this question
or