Display zero as blank in label control

  • Thread starter Thread starter Brad Parks
  • Start date Start date
B

Brad Parks

I want to display numeric values (integers & doubles) in label
controls. If the values are 0 they should display nothing.

Is there a better way than the following?

Label.Text = IIf(rdr("Total") = 0, "", String.Format("{0:0.00}",
rdr("Total")))
 
I was wondering if there is a special String.Format for displaying 0
as "", rather than using If or IIf.
 
Back
Top