Dim i as Double = 3256.4532
Dim Output as string
Output = i.ToString("0000.00")
อีกตัว
Code (VB.NET)
Dim result = String.Format("{0:D5}", number)
Date :
2013-01-11 12:40:40
By :
mr.win
No. 2
Guest
Code (VB.NET)
Imports System
Namespace StripDecimal_VB
Class RemoveDecimal
Shared Sub Main(ByVal args As String())
Dim testNum As Double = 255.95
Dim noDecimalVal As String = testNum.ToString().Replace(".", "").PadLeft(9, "0"c)
Console.WriteLine("Original Value: " + testNum.ToString())
Console.WriteLine("Value w/No Decimal: " + noDecimalVal)
End Sub
End Class
End Namespace