Sunday, November 21, 2010

How do you display a number to 2 decimal places in VB 2005?

How would I show the price which is saved in variable (Total2) to 2 decimal places?



Console.Write(';Price: 拢';)

Console.WriteLine(Total2)How do you display a number to 2 decimal places in VB 2005?
Use the Format() command:



Format(Total2, ';$#0.00';) (How did you get the Pound character? I just used the American ';$'; in my example.)

No comments:

Post a Comment