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

Show formatted number using DataFormatString of GridViewDataColumn

2 Answers 1058 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Nagisa
Top achievements
Rank 1
Nagisa asked on 21 Dec 2011, 01:38 AM
Hi

I have a problem with  formatting number shown in GridViewDataColumn.
I want to show a number like "#.##########"("{}{0:N10}") with zero at right of decimal trimmed.

for example:
A value of "12.12345678912"  should be shown as "12.1234567891".
But a value of "12.12345678000"  should be shown as "12.12345678".

Is there any way to resolve the  problem by setting DataFormatString ? or should I resolve it by other way like handling TextChanged event.

Best Regards 


2 Answers, 1 is accepted

Sort by
0
Nagisa
Top achievements
Rank 1
answered on 21 Dec 2011, 06:07 AM
I've resolved it with setting format string with "{}{0:###,###.##########}".

Is there any reference about  syntax of format string?

Best Regards
0
Maya
Telerik team
answered on 21 Dec 2011, 07:31 AM
Hi Nagisa,

You can run through this article for standard numeric format string and this one for custom numeric format string
Let me know in case you need any further assistance.

Regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
Nagisa
Top achievements
Rank 1
Answers by
Nagisa
Top achievements
Rank 1
Maya
Telerik team
Share this question
or