Number format in schema model field

1 Answer 328 Views
Data Source Spreadsheet
Ian
Top achievements
Rank 1
Iron
Ian asked on 30 Aug 2021, 01:40 PM | edited on 30 Aug 2021, 01:41 PM

HI,

I have a Kendo UI spreadsheet control bound to a datasource. I need to format the currency fields within to include a thousand separator as follows 13,000,000. How is this possible in the schema/model/fields. Here is my code:

schema: {
                    model: {
                        id: "ItemId",
                        fields: {
                            ItemAmount: { type: "number", format: "#,#" }
                        }
                    }
                }

 

This doesn't work and the number is displayed as 13000000

 

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 02 Sep 2021, 09:40 AM

Hello, Ian,

As stated in the DataSource binding documentation, formats, formulas and styles are not persisted when binding to a dataSource. A possible approach would be to use the format method for a specific range and set the desired format. Here is a small example for reference.

Let me know if you have any further questions.

Regards,
Martin
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Ian
Top achievements
Rank 1
Iron
commented on 03 Sep 2021, 01:29 PM

Hi Martin

Thanks so much for this answer, i will give it a try

Ian

Tags
Data Source Spreadsheet
Asked by
Ian
Top achievements
Rank 1
Iron
Answers by
Martin
Telerik team
Share this question
or