• Upgrade your Internet Experience
  • Sign in
  • Microsoft.com
  • United States (English)
    Brasil (Português)Česká republika (Čeština)Deutschland (Deutsch)España (Español)France (Français)Italia (Italiano)Россия (Русский)대한민국 (한국어)中华人民共和国 (中文)台灣 (中文)日本 (日本語)香港特别行政區 (中文)
 
 
Resources for IT Professionals
 
 
 
Resources for IT Professionals > Forums Home > Crystal Reports for Visual Studio > Convert Currency to Words (Indian Format) in Crystal Reports
Ask a questionAsk a question
Search Forums:
  • Search Crystal Reports for Visual Studio Forum Search Crystal Reports for Visual Studio Forum
  • Search All Microsoft Forums Search All Microsoft Forums
 

AnswerConvert Currency to Words (Indian Format) in Crystal Reports

  • Tuesday, May 29, 2007 1:17 PMTasnim M Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0
    Hi,
    Please can anyone help me how to convert number to words in Indian format in Crystal Reports.
     eg. I want to convert Rs.25,12,000 as Rupees Twenty Five Lakhs Twelve thousand only.
    I had tried to use ToWords() function but the result is in Millions and Billions. I want the result in Lakhs and crores. Please Help.

    Thanks in advance.
    • ReplyReply
    • QuoteQuote
     

Answers

  • Thursday, May 31, 2007 3:38 PMcaptJackSparrow Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Vote As Helpful
    0

    If you are using dataset then you can add another column and use your VB function to convert amount to words and use this dataset column in your report that would be easiest, otherwise you can create formula in CR same way you created in VB.As far as using VB function in Cr is concerned, i read somewhere that you can import DLL in crystalreports to use function written outside CrystalReports.

     

    • ReplyReply
    • QuoteQuote
     

All Replies

  • Thursday, May 31, 2007 7:37 AMcaptJackSparrow Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0

    I dont think there is any currency specific formula in CR, what you will need to do is create custom function in your code.

     

    If you are using Oracle as backend, there is one easy way for conversion, playing with julian date and numbers.

    • ReplyReply
    • QuoteQuote
     
  • Thursday, May 31, 2007 1:19 PMTasnim M Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0
    thanks a lot for replying.

    I am using SQL Server 2000 as my backend. Can you Please suggest me how do I Proceed.

    Create a custom function in my code... means do I need to write it in crystal syntax in the formula editor?
    I have written a function in vb.net, can I use it in CR by any way?
    • ReplyReply
    • QuoteQuote
     
  • Friday, June 01, 2007 2:23 PMTasnim M Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0
    I am not using dataset for CR. Instead of adding column in dataset I added a column in the database itself.
    Thanks a lot for all the solutions.
    • ReplyReply
    • QuoteQuote
     
  • Monday, May 05, 2008 1:45 PMPrem Prakash Sharma Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0

    numbervar RmVal:=0;
    numbervar Amt:=0;
    numbervar pAmt:=0;
    stringvar InWords :="Rupees ";
    Amt := Amount to convert;
    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);
    if Amt = 100000 then RmVal := 1;
    if RmVal >=1 then
    InWords := InWords + " " + towords(RmVal,0) + " lakhs";

    Amt := Amt - Rmval * 100000;
    if Amt > 0 then InWords := InWords + " " + towords(truncate(Amt),0);
    pAmt := (Amt - truncate(Amt)) * 100;
    if pAmt > 0 then
    InWords := InWords + " and " + towords(pAmt,0) + " paisa only"
    else
    InWords := InWords + " only";
    UPPERCASE(InWords)

     

     

    • ReplyReply
    • QuoteQuote
     
  • Tuesday, May 27, 2008 10:57 AMHiran KM Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Proposed Answer
    Vote As Helpful
    0

    Dear Tasnim,

    Please try with this code

     

    numbervar RmVal:=0;
    numbervar Amt:=0;
    numbervar pAmt:=0;
    stringvar InWords :="Rupees ";

    Amt := type your value ; // 25,12,000


    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);
        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);

            pAmt := (Amt - truncate(Amt)) * 100;

            if pAmt > 0 then
                InWords := InWords + " and " + towords(pAmt,0) + " paisa only"
            else
                InWords := InWords + " only";

            UPPERCASE(InWords)

     

     

     

    Hiran KM

    kmhiran@gmail.com

    hirankmohan@yahoo.co.in


     

    • Proposed As Answer byRajesh Rakyan Tuesday, May 12, 2009 6:56 AM
    •  
    • ReplyReply
    • QuoteQuote
     
  • Tuesday, May 27, 2008 11:03 AMHiran KM Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0

    Hi

     

    please try with this script

    you can use it as a formula field

     

     

     

    numbervar RmVal:=0;
    numbervar Amt:=0;
    numbervar pAmt:=0;
    stringvar InWords :="Rupees ";

    Amt := 25,12,000  ;


    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);
        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);

            pAmt := (Amt - truncate(Amt)) * 100;

            if pAmt > 0 then
                InWords := InWords + " and " + towords(pAmt,0) + " paisa only"
            else
                InWords := InWords + " only";

            UPPERCASE(InWords)

     

    Warm Regards,

    Hiran

    kmhiran@gmail.com

     

    • ReplyReply
    • QuoteQuote
     
  • Thursday, July 10, 2008 5:14 AMClaire Chan Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0
    please try this, 1st you create a formula : NumToWords1

    towords(truncate(sum({C_PaymentItem.AMOUNT}),0))

    after that the second formula: NumToWords1

    if Round({@Total Amount},2) - Int({@Total Amount}) = 0 then
    "Ringgit Malaysia: " + ToWords ({@Total Amount},0) + " only"
    else
    "Ringgit Malaysia: " + {@
    NumToWords1}  + " and " + "Cents " + ToWords ((Round({@Total Amount},2) - Int({@Total Amount})) * 100, 0) + " only"
    • ReplyReply
    • QuoteQuote
     
  • Tuesday, November 11, 2008 10:11 AMakku555 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0
    hello i can solve your problem. contect with me.9436037998 or your emailid for attechment the code. thanks
    • Edited byakku555 Tuesday, November 11, 2008 10:24 AM
    •  
    • ReplyReply
    • QuoteQuote
     
  • Saturday, November 15, 2008 5:04 PMthesuraj Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0

    Hi,

    I have been the same problem before.

    Then, i developed SQL functions to convert number input to words and used the same in report.

    Now, I am able to use in any application whenever required.

    I have posted completed functions with codes to convert amount in numbers to words acc. to Indian numbering style in following link. Plz, check out.

    Convert Amount into Words according to Indian or Nepali Numbering Style.

     

    • Edited bythesuraj Saturday, November 15, 2008 5:05 PM
    •  
    • ReplyReply
    • QuoteQuote
     
Need Help with Forums? (FAQ)
 
© 2009 Microsoft Corporation. All rights reserved.
Manage Your Profile
|
Contact Us
|
Newsletter
|
Terms of Use
|
Trademarks
|
Privacy Statement