Page 1 of 1

For your info - how the amount in words printed on a check?

PostPosted: Fri Jul 18, 2008 3:38 pm
by jayind
Did you ever think the logic how the amount in WORDs printed on a check?

For example: $112.30 - ONE HUNDRED AND TWELVE DOLLARS AND THIRTY CENTS!!!!

Solution (if you are not aware)

I was undergoing a training and the trainer asked this question. I suggested a general logic
divide the amount by 1000, 100, 10 respectively to get THOUSANDs, HUNDREDs and ONEs...
but he has given a simple logic in COBOL..
Here is the logic and just wanted to share with you....

define a variable

01   AMT          PIC 9(5).9(2)
01   AMT-X redefines AMT.
   05 AMT-THOUSANDS                    PIC X(2).
   05 AMT-HUNDREDS                    PIC X(1).
   05 AMT-TENS      PIC X(1).
   05 AMT-ONES      PIC X(1).
   05 AMT-DOT      PIC X(1).
   05 AMT-DECIMALS                   PIC X(2).


And little more code is required for validations if ‘0’s present in the respective field values..

Usually this is a subroutine in the existing systems just by passing the value we get the required....
Just thought to share the info with you...

Regards,
jayind

Re: For your info - how the amount in words printed on a check?

PostPosted: Wed Jul 23, 2008 4:38 pm
by ritwik.das
This is really cool! Jayind, thanks a lot.

Regards!
Ritwik