Decimal number with preceding 0's

mcdonger

Member
Joined
Mar 18, 2007
Messages
16
Location
England
Programming Experience
1-3
I have a decimal number, which I want in the format of an array of the integer values of each digit. so for example:

09.40
as an array:
{0, 9, 4, 0}

My current code (I get the trailing 0's with this, but not the preceding ones, and so the array is not of constant size which makes the next stage of my coding difficult):
VB.NET:
                Dim x As Integer
                Dim y As Decimal
                Dim ca() as Char

            x += 1
            y = x / 23
            y = Format(y, "00.00")
            ca = y.ToString.Replace(".", "").ToCharArray()

Thanks in advance
 
Format is a String function, won't do you any good when implicitly converting it back to a number type.
VB.NET:
Dim x As Integer = 1
Dim s As String = x.ToString("00.00")
 
Back
Top