Hi all I have applied display format string for a label as follows
<dx:ASPxLabel ID="lblPrice" runat="server" Text='<%#Eval("Price")!=DBNull.Value? string.Format("{0:c}", Eval("Price")) :string.Format("{0:c}","0.00") %>' />
This is displaying the amount with $ symbol when it is having data but when null for 0.00 it is not displaying the $ symbol can some one help me
You need to pass some numeric literal into
Formatmethod, so that the currency format{0:c}can be applied, but you are passing string literal"0.00". Try to change"0.00"literal to either0.0or0or0.00, choose the most readable literal for you.write
instead of
You can also simplify code a bit to: