Follow by Email

Saturday, 15 September 2012

How to show value upto two decimal places even if the value is integer

In case of Code behind Page:

  double d = Convert.ToDouble(TextBox1.Text);
  Label1.Text = d.ToString("0.00");

In case of Eval in .aspx Page:

Text='<%# Convert.ToDouble(Eval("QTY")).ToString("0.00") %>'>


Post a Comment

Design by Abhinav Ranjan Sinha