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

Spreadsheet percentage format does unexpected things

1 Answer 408 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
iFACTS Admin
Top achievements
Rank 1
iFACTS Admin asked on 10 Oct 2017, 10:08 AM

Hi!

Please have a look at this demo: http://dojo.telerik.com/AWamE

Last 2 columns should behave the same. Only difference between then is the format specifier, once is '%' second is 'prc'.

But they are not. The '%' sees the column as percentage, so:

1. Multiplies the value I give with 100

2. When editing, % remains in place, even though in the second part it disappears. I would like to have it gone

 

Any ideas on how to make the % fields behave just like other format specifiers?

Thanks!

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Joana
Telerik team
answered on 12 Oct 2017, 06:42 AM
Hi Peter,

The % is a special formatting symbol which indeed multiplied the number by 100 and insert percentage symbol in the cell. If you need to prevent this behavior, you should add double backslash before the % symbol in the formatting string: 

{
     value: 12,
     format: '#,0.00 \\\%'
}

Here is the updated dojo: http://dojo.telerik.com/AWamE/2 and an article that contains more information about the number formatting:

https://docs.telerik.com/kendo-ui/framework/globalization/numberformatting#custom

Regards,
Joana
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Spreadsheet
Asked by
iFACTS Admin
Top achievements
Rank 1
Answers by
Joana
Telerik team
Share this question
or