Hi there,
whats the handiest way to always display 2 digits after a decimal point. Im using a double and i will convert it to String before displaying but i need it to show the 2 decimal places as the example below
Eg
5 -> 5.00
5.0 ->5.00
5.50->5.50
Printable View
Hi there,
whats the handiest way to always display 2 digits after a decimal point. Im using a double and i will convert it to String before displaying but i need it to show the 2 decimal places as the example below
Eg
5 -> 5.00
5.0 ->5.00
5.50->5.50
VB Code:
Dim DoubleVar as Double=5D MsgBox(DoubleVar.ToString("N2"))
http://msdn.microsoft.com/library/de...ringtopic2.asp
There is a more detailed explanation there of the Double.ToString method.
Bill
ya just found a good link there http://www.programmers-corner.com/sourcecode/125