Return to Snippet

Revision: 14619
at June 7, 2009 19:35 by rtipton


Updated Code
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

Revision: 14618
at June 7, 2009 19:28 by rtipton


Initial Code
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(noDecimalVal)
        End Sub
    End Class
End Namespace

Initial URL

                                

Initial Description

                                

Initial Title
Strip Decimal and Zero Fill

Initial Tags

                                

Initial Language
VB.NET