Hi everyone
I am using datatable of string datatype as one of the column... it contains value of string and decimal values both. When it contains decimal value,it shows upto 10 digit decimal point... i want to show upto 2 decimal point.
For eg.
%less - is a column name which contains string datatype
Mrp - is of decimal datatype
Sales price - decimal datatype
I had implemented an expression in datatable that
If ( mrp =0)
%less =N/A
Else
(((Mrp - salesprice)*100)/mrp)
It is calculating perfectly but not upto 2 decimal point.
When I use round or cast function to get it roundoff, datatable shows blank value
I also used grid autogeneratingcolumn event
And set the column binding format to 0.00
This also doesnt work.
Kind provide me a decent solution for this...
It would really be appreciateable
Regards
Amit
Round off in string datatype
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


ali tuncerRank #1,499 · 1.1K reputationPosted Mar 6, 2016, 3:23 PM EST
In grid try this :
<%#Eval("ColumnName", "{0:0.##}") %>
Amit KumarRank #459 · 5.4K reputationPosted Mar 6, 2016, 6:30 PM EST