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

Numeric formatting on GridCell not working on load

2 Answers 306 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 06 Aug 2019, 10:31 PM

Hi there,

I'm trying to format the numbers within a GridCell to display as currency. Setting the format prop to '{0:c}' or '{0:a}' does not format the values that appear in those cells when the grid first loads. However, after editing any of the values in that cell or creating a new cell, the formatting works and the value displays as intended. I must be missing something...

 

Thanks for any help!

-Tim

2 Answers, 1 is accepted

Sort by
0
Accepted
Stefan
Telerik team
answered on 07 Aug 2019, 10:07 AM
Hello, Tim,

By default the format is working as expected on load:

https://stackblitz.com/edit/react-vncdgj?file=app/main.jsx

I can assume that there is a small detail missing, which is causing this.

Is it possible to share an example or at least the code used in the application?

Regards,
Stefan
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Tim
Top achievements
Rank 1
answered on 07 Aug 2019, 09:17 PM
Hey Stefan - Thanks for the reply with the code sample - the issue was the data coming into the grid was initially a string, not a decimal number. Converting it on the backend resolved the issue and the formatting is now working as expected. Thanks!
Tags
General Discussions
Asked by
Tim
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Tim
Top achievements
Rank 1
Share this question
or