Cubbie
April 5th, 2001, 05:49 AM
Looking for a better/simpler way to format a fixed length dollar and cents string. I want to format the string to 10 positions with the last 2 positions being the cents without the decimal point. For example 86.38 needs to be 0000008638. Here is what I currently have:
Dim TPAmt as string 'TP dollar amount
Dim TPCents as string 'TP cents amount
TPCents = Right$(txtData(3), 2) 'TP Cents
'set and format Amount variables
TPAmt = Fix(txtData(3).Text)
TPAmt = Format$(TPAmt, "00000000") & TPCents
Dim TPAmt as string 'TP dollar amount
Dim TPCents as string 'TP cents amount
TPCents = Right$(txtData(3), 2) 'TP Cents
'set and format Amount variables
TPAmt = Fix(txtData(3).Text)
TPAmt = Format$(TPAmt, "00000000") & TPCents