I have the following Column in my gridview
<asp:BoundField ItemStyle-Font-Bold="true"
DataFormatString="£{0:C2}" DataField="PriceBasePrice"
HeaderText="Price you pay" ItemStyle-Width="120" />
The value being passed to the Column is 180.0
I thought that with:
DataFormatString="£{0:C2}"
The Value would return as £180.00
but it returns as £180.0
Does anyone know what DataFormatString I should use ?
You may need to set the HtmlEncode attribute to false preventing the value being cast to a string first.
Alternatively you could just specify you’re own format string:
The # are empty until replaced with a value if one exists and the 0 are replaced with a value if one exists, otherwise they stay as 0.
Se Custom Numeric Format Strings – http://msdn.microsoft.com/en-us/library/0c899ak8.aspx