BPM ABL - calculated field question

>>STRING(ApTran.DocTranAmt * 100,"9999999999")
Looks like I can use this one.

>>Replace(String(Round(ApTran.DocTranAmt,2), "9999999999.99"), ".", "")
If I remove one of the 9's it looks like it will work too.
i.e. Replace(String(Round(ApTran.DocTranAmt,2), "999999999.99"), ".", "")

Thanks,
I knew I had gotten onto a bad tangent.
This cleans it up nicely.
I'm looking for ideas for on a calculated value where I need to convert decimal values into strings for a bank trans export file. BPM ABL output to a text file.

The string values must be 11 characters long, RH justified, no decimal point and padded with leading zeros.


Example:

APTran.DocTranAmt == 11 chars RH justified, no decimal point
179.91 ============ 00000017991
237.2 ============= 00000023720 (note: no trailing zero stored in the database)
724.09 ============ 00000072409
253.12 ============ 00000025312


The samples below are from my prototype.

Working for now but... looks pretty ugly. 

Thanks in advance for any suggestions.


calcLeadingZeros:
FILL('0',9 - Length(Substring(Left-Trim(String(APTran.DocTranAmt)), 1,Length(Left-Trim(String(ApTran.DocTranAmt))) - (Length(Substring(String(Round(ApTran.DocTranAmt,2)),INDEX(String(Round(ApTran.DocTranAmt,2)) , '.') + 1,2)) + 1) )))

calcWholeAmt:
Substring(Left-Trim(String(APTran.DocTranAmt)), 1,Length(Left-Trim(String(ApTran.DocTranAmt))) - (Length(Substring(String(Round(ApTran.DocTranAmt,2)),INDEX(String(Round(ApTran.DocTranAmt,2)) , '.') + 1,2)) + 1) )

calcDecimal:
If Length(Substring(String(Round(ApTran.DocTranAmt,2)),INDEX(String(Round(ApTran.DocTranAmt,2)) , '.') + 1,2)) = 1
then
(Substring(String(Round(ApTran.DocTranAmt,2)),INDEX(String(Round(ApTran.DocTranAmt,2)) , '.') + 1,2)) + "0"
else
(Substring(String(Round(ApTran.DocTranAmt,2)),INDEX(String(Round(ApTran.DocTranAmt,2)) , '.') + 1,2))





I didn't test it, but what about:

Replace(String(Round(ApTran.DocTranAmt,2), "9999999999.99"), ".", "")


Or you can use this.

STRING(ApTran.DocTranAmt * 100,"9999999999")