Hi,
I want to show my column data up to two decimal places. I am doing band.Columns[columnname].Format = "(#,##0.00)" or band.Columns[columnname].Format = {0:0.00}.
By doing this it is showing values up to two decimal places, however not showing value up to two decimal places where values are like 0.9. I want to show 0.9 to 0.90. Which is not happening in this case.
And for this "(#,##0.00)" - data is coming as 9.0E4.
Please tell me how I can show right data on the screen.
Thanks and Regards,Rosy Malhotra
I'm not sure what's going on here; are you sure that the underlying value is 0.9? I just tried this out and the format string of "#,##0.00" works fine for me (the parenthesis in the format string just cause them to appear as literals in the generated string). All that the grid does is use the format string to call ToString() on the underlying object; do you get the same behavior if you call ToString("#,##0.00") on your object?
-Matt
Hi Matt,
Thanks for your reply.
This is not letting me do this with ToString("#,##0.00"), I am creating columns and setting the format to the columns.
Let me explain you the scenario.
My data is coming from a datatable and and there is not datatype specified. I am setting the format of the column like this:
band.Columns[columnname].Format = "{#,##0.00}";
But still data present in the datatable '0.9' displaying as is 0.9 not 0.90.
I think that you misunderstood what I wrote. What I meant was that the column calls (0.9).ToString("{#,##0.00}") when you assign that as the format string of the column, so I'd like to know if you get the same result if you call that method yourself. Regardless, using this format string, the data correctly appeared as "0.90", so I'm not really sure what your best option is. You should submit a sample to Developer Support so that they can look into it.