i used the bellow formula for disply laksh in crystal reports . but it returns 'hundred' for 'lakh'.
for e.g. i have used towords formula on 738195.12,and the output is 'Rupees seven hundred thirty-eight thousand one hundred ninety-five and twelve'. what should i do now???
if
right(Totext({amount}),2)="00"
then
uppercase(ToWords({amount},0))+" "+"Only"
else
uppercase(ToWords({amount},0))+" AND "+uppercase(ToWords(tonumber(right(Totext({amount}),2)),0))+" "+"Paisa Only"
Loading

Fathima JabbarPosted Oct 20, 2014, 4:57 AM
You could create a running total field for summing up and pass it in the formula.
This worked for me. You check it.
Prasad BhagatPosted Oct 18, 2014, 1:19 AM
Thankyou for your reply
but madam still iam having same prob becoz i don't have database field a have a sum field in that crystal report so it was getting same error
if possible please help me
Fathima JabbarPosted Oct 14, 2014, 7:01 AM
You could create a formula field for converting number to words.
Hope the following sample could help you.
numbervar RmVal:=0;
numbervar Amt:=0;
stringvar InWords :="";
Amt := {Command.DB_FIELD}; // you can pass your db field here.
if Amt > 10000000 then
RmVal := truncate(Amt/10000000);
if Amt = 10000000 then
RmVal := 1;
if RmVal = 1 then
InWords := InWords + " " + towords(RmVal,0) + " crore"
else if RmVal > 1 then
InWords := InWords + " " + towords(RmVal,0) + " crores";
Amt := Amt - Rmval * 10000000;
if Amt > 100000 then
RmVal := truncate(Amt/100000)
else if Amt = 100000 then
RmVal := 1;
if RmVal = 1 then
InWords := InWords + " " + towords(RmVal,0) + " Lakhs"
Else if RmVal > 1 then
InWords := InWords + " " + ToWords(RmVal,0) + " Lakhs";
Amt := Amt - Rmval * 100000;
if Amt > 0 then
InWords := InWords + " " + towords(truncate(Amt),0);
InWords := InWords + " only";
UPPERCASE(InWords)
Regards,
Fathima Jabbar.
Prasad BhagatPosted Oct 10, 2014, 5:24 AM
Thanks for your reply but my question is disply the numbers into words incrystal reports not in c#,
and i want disply a number 122202 value into words like one lakh twenty two thousend two hundred and two rupees
while displying the words iam passing not a number iam passing a field like sum field
some other portals are showing some code but it has to be pass a number
insted of that i want pass a field
if possible let me know
Vithal WadjePosted Oct 9, 2014, 11:43 AM
http://www.c-sharpcorner.com/UploadFile/0c1bb2/converting-a-number-to-string-in-Asp-Net-and-C-Sharp/