Wednesday, November 4, 2009 2 comments

Printing Check Amount With Decimal Part

Yesterday was not really a good day for me. because a simple fix on the check amount dragged my entire day till 10pm. But it kinda helped me to explore lot of stuff.

Let me come straight to the actual problem.

Currently we are showing the checkamount padded with asterisk(*) like *******1200 (I will use this value for by below examples). Here is how I pad the asterisk
<?xdofx:lpad(PaymentAmount/Value,12,'*')?>

Since there is no decimal part in this value the bank some times considers the last 2 digits from the right as the decimal part. In this case they consider 00 as decimal part and paid only 12 dollar. To avoid this confusion we decided to print the decimal part also so that the amount will look like ****1200.00