Thursday, June 16, 2011

Crystal Report toWords() function display amount in words with decimal values


I have to display amount in Words with decimal values in my report for achieving this i wrote small formula in Crystal Report 

here is the formula:





numbervar Value;
numbervar deciValue;
Value:={ES_RPT_SP_AdvPaymentPRC;1.RECEIVED_AMOUNT};
deciValue:= Value- Truncate(Value);  //separate decimal value
Value := truncate(Value);
deciValue:= deciValue* 100;
if deciValue= 0 then
propercase(ToWords (Value,0) +' only')
else
propercase(ToWords (Value,0) + ' And '+ToWords(deciValue,0) + ' Paisas Only ')

here is the output for 2222.44

3 comments:

  1. Hi, thank you very very much; helped me a lot!!!

    ReplyDelete
  2. You are Really Great, this is the smallest Code I come across.

    ReplyDelete

Asp Classic Upload File Issue

Recently I have migrated asp classic application from old server to new server . I found file upload is not working in new IIS 7 Server . I ...