Thursday, October 18, 2012

Program to Convert Numberic to Word

* Author      : Team of Pelagian Softwares
* Date        : 11/10/2004
* Source      : rupword.prg
* Description : Program to Convert Numberic to Word


set print off
set talk off
unt='One       Two       Three     Four      Five      Six       '
unt= unt+'Seven     Eight     Nine      Ten       Eleven    Twelve    '
unt= unt+'Thirteen  Fourteen  Fifteen   Sixteen   Seventeen Eighteen  '
unt= unt+'Ninteen'
ten='Twenty    Thirty    Fourty    Fifty     Sixty     Seventy   '
ten= TEN+'Eighty    Ninty'
clth='Crore     Lac       Thousand  Hundred               '



input 'ENTER RS. FOR WORD : ' to n1
wlen=len(str(n1))
stor '' to word,w1,w2,w3
num=n1
l=1
x=10000000
do whil l<=60
 if num>=x
  if num<1 span="span">
   n=round(num*100,0)
   word=word+' And Paise'
  else
   n=int(num/x)
   num=num-n*x
  endI
  if n>19
   xx=int(n/10)*10
   word=word+' '+trim(subs(ten,xx-19,10))
   n=n-xx
  endI
  if n>0
   word=word+' '+trim(subs(unt,n*10-9,10))
  endI
  word=word+' '+trim(subs(clth,l,10))
 endI
 l=l+10
 x=iif(x=1000,100,x/100)
endD
w1=ltrim(word+' Only')
?w1
?

No comments:

Post a Comment