Hi,
I am using DataBoundGrid 1.6.1.8.
I have a decimal column. How do I remove trailing Zeros from the decimal number when I show it in all my grids?
FYI, run CurrencyCells sample and set one of the CellType to "TextBox" and CellValueType to decimal. If you enter "53.89400", it converts the value to "53.894". How can I get the same behavior in a databound grid?
thanks,
- Reddy
AD
Administrator
Syncfusion Team
January 22, 2004 09:26 PM UTC
Try setting:
GridStyleInfo style = this.gridDataBoundGrid1.Binder.InternalColumns[2].StyleInfo;
style.CellValueType = typeof(double);
style.Format = "0.000";
AD
Administrator
Syncfusion Team
January 22, 2004 09:29 PM UTC
If you do not want to always have 3 decimal places, you can use the # formatting character instead of the 0.
style.Format = "0.###";
1.200000 is shown as 1.2
1.1234567 is shown as 1.123