Currency format in Grid not working

1 Answer 850 Views
Grid
Julia
Top achievements
Rank 1
Julia asked on 26 Apr 2022, 03:34 PM
               

I need to format the number in Grid as $123.00 or $123.25. The input comes from a modal form.

ViewModel has these values as Double.

Neither format attempts are working, the numbers are displayed as entered.

So if the user entered 1, it should display as $1.00, but instead it displays as 1.

columns.Bound(p => p.MyNumericValue).Title("MyTitle").ClientTemplate("#= kendo.toString(MyNumericValue, '{0:0.00}') #");
 columns.Bound(p => p.MyNumericValue).Title("MyTitle").Format("{0:0.##}");

 

Thanks.

1 Answer, 1 is accepted

Sort by
0
Tsvetomir
Telerik team
answered on 29 Apr 2022, 10:32 AM

Hi Julia,

Could you try using the c2 option that is used for the currency format and is provided out-of-the-box?

columns.Bound(p => p.MyNumericValue).Title("MyTitle").ClientTemplate("#= kendo.toString(MyNumericValue, 'c2') #");

Let me know if the issue persists.

 

Kind regards,
Tsvetomir
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.

Tags
Grid
Asked by
Julia
Top achievements
Rank 1
Answers by
Tsvetomir
Telerik team
Share this question
or