Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

problem in spell_amount

Former Member
0 Likes
559

hi all,

I m having a requirement in which i need to put 'and' in between the converted string which i m getting as o/p from spell_amount FM.

e.g. if i give as 1234.00 its giving me as one thousend two hundred thirty four.

But i should print as one thousend two hundred <b>AND</b> thirty four. I can get it through finding string 'hundred' in the o/p and after that i can concatenate AND, but problem is if there are multiple occurences of ' Hundred' if m facing a problem.

Please help.

Points will be rewarded accordingly.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
538

Hi

suppose if u have string like 1234.00 here pass last two digits to one more string let us say 34 to str1 and replace 0's with 34, 1200 and pass it to srting str2.

now call spell_amount to str1 and str2.

now str2 will result one thousand two hundered

and str1 will result thirty four

now concatenate str2 'AND' str1 into final_string

kiran.M

4 REPLIES 4
Read only

Former Member
0 Likes
539

Hi

suppose if u have string like 1234.00 here pass last two digits to one more string let us say 34 to str1 and replace 0's with 34, 1200 and pass it to srting str2.

now call spell_amount to str1 and str2.

now str2 will result one thousand two hundered

and str1 will result thirty four

now concatenate str2 'AND' str1 into final_string

kiran.M

Read only

0 Likes
538

str = 1234.00

split string at '.' into str1 , str2.

str1 = 1234

str2 = 00

len = strlen (str1). =4

len1 = len - 2. = 2

str3 = str + len1(2). =34

str4 = str1 + 0(len1). =12

concatenate str4 '00' into str5. =1200

now u have 1200 in str5 and 34 in str3.

pass str5 and str3 to spell_amount FM.

Reward if it is helpful.

kiran.M

Read only

0 Likes
538

but what if i have multiple 'hundreds' in my amount/

Read only

0 Likes
538

hI

First check my logic and understand i am spliting last two digits (34 ) and concatenating with 'AND'.

check once...