Search This Blog

Wednesday, May 5, 2010

How to convert Currency To word in Crystal report

if (CDbl ({@RS}) <= 99999) then
ToWords(CDbl ({@RS}),0)
else if (CDbl ({@RS}) <= 9999999) then
ProperCase(ToWords(CDbl (Left (replace ({@RS}, ",",""), LEN(replace ({@RS}, ",",""))-5)),0) + " Lac " + ToWords(CDbl (Right (replace ({@RS}, ",",""),5)),0))
else if (CDbl ({@RS}) <= 999999999) then
ProperCase(
ToWords(CDbl (Left (replace ({@RS}, ",",""), LEN(replace ({@RS}, ",",""))-7)),0) + " Crore "+
ToWords(CDbl (Right(Left (replace ({@RS}, ",",""), LEN(replace ({@RS}, ",",""))-5),2)),0) + " Lac " +
ToWords(CDbl (Right (replace ({@RS}, ",",""),5)),0)
)
else if (CDbl ({@RS}) <= 99999999999) then
ProperCase(
ToWords(CDbl (Left (replace ({@RS}, ",",""), LEN(replace ({@RS}, ",",""))-9)),0) + " Arab "+
ToWords(CDbl (Right(Left (replace ({@RS}, ",",""), LEN(replace ({@RS}, ",",""))-7),2)),0) + " Crore "+
ToWords(CDbl (Right(Left (replace ({@RS}, ",",""), LEN(replace ({@RS}, ",",""))-5),2)),0) + " Lac " +
ToWords(CDbl (Right (replace ({@RS}, ",",""),5)),0)
)

1 comment:

  1. Wow i can say that this is another great article as expected of this blog.Bookmarked this site.. convert money

    ReplyDelete