Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

check amount printing - variable no of asterisks

Avatar

Former Community Member

Hi Experts,

I have a requirement which runs as follows -

I need to print check amount in words with integral and decimal part being separated by asterisks.

for e.g. if the check amount is $1234.56, then the check amount in words will come as follows -

ONE*THOUSAND*TWO*HUNDRED*THIRTY*FOUR*************************************************

************************************************************************************************and*56/100

1234567.56 will be shown as -

ONE*MILLION*TWO*THIRTY*FOUR*THOUSAND*FIVE*HUNDRED*SIXTY*SEVEN*************

************************************************************************************************and*56/100

1234567.00 will be shown as -

ONE*MILLION*TWO*THIRTY*FOUR*THOUSAND*FIVE*HUNDRED*SIXTY*SEVEN*************

************************************************************************************************and*00/100

the amount in words should be displayed in exactly 2 lines.

this is how I have attempted till now in ADLC - I am placing the script in the form ready event of the form.

there are 3 fields - one for integral part of the check amount in words, the second one for decimal part and the third field is for

final exp - I need to control the no of asterisks

The width of the final field is fixed.

Script excerpt -

check printing amount in words.JPG

whenever I am running this script the while loop falls into a infinite loop.

Thie behavior is understandable considering the fact that textfield width change

due to addition of a asterisk character is miniscule.

Is there any better way to approach this problem?

Regards,

Rohit

0 Replies