Convert Number to Word

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rajiv07
    New Member
    • Jun 2007
    • 141

    Convert Number to Word

    Hi to all ,

    Is any Perl module for converting number to word

    Ex. 1-one
    2-two

    Is any idea please.

    Thanks.
  • numberwhun
    Recognized Expert Moderator Specialist
    • May 2007
    • 3467

    #2
    Originally posted by rajiv07
    Hi to all ,

    Is any Perl module for converting number to word

    Ex. 1-one
    2-two

    Is any idea please.

    Thanks.
    Have you gone out to cpan and searched for numbers to words?

    You should really try searching yourself before posting as we will quite possibly ask you what your returned.

    Regards,

    Jeff

    Comment

    • minowicz
      New Member
      • Feb 2008
      • 12

      #3
      Originally posted by numberwhun
      Have you gone out to cpan and searched for numbers to words?

      You should really try searching yourself before posting as we will quite possibly ask you what your returned.

      Regards,

      Jeff
      I always enjoy seeing the self-righteo, erm... helpful people post 'answers' like this.

      The CPAN Search you recommend above returns 415 results, of which the two most appropriate (in my own opinion) _real_ answers (Lingua::EN::Num bers or Lingua::EN::Num bers::Easy ) are not to be found on the first page of results. In fact, Linuga::EN:Numb ers::Easy does not show up until page 32, where it is the 315th result and Lingua::EN::Num bers doesn't even make the results list at all.

      Comment

      • KevinADC
        Recognized Expert Specialist
        • Jan 2007
        • 4092

        #4
        Originally posted by minowicz
        I always enjoy seeing the self-righteo, erm... helpful people post 'answers' like this.

        The CPAN Search you recommend above returns 415 results, of which the two most appropriate (in my own opinion) _real_ answers (Lingua::EN::Num bers or Lingua::EN::Num bers::Easy ) are not to be found on the first page of results. In fact, Linuga::EN:Numb ers::Easy does not show up until page 32, where it is the 315th result and Lingua::EN::Num bers doesn't even make the results list at all.
        If you wish to elaborate on a suggestion another person made, you should, or correct them if they made a mistake, or show a better way of doing something, those are all welcome and I think appreciated but the condesending attitude is not welcome. Everyone is free to help to the extent they want to, by suggesting a general search of CPAN or specific modules or whatever.

        Comment

        • minowicz
          New Member
          • Feb 2008
          • 12

          #5
          Originally posted by KevinADC
          If you wish to elaborate on a suggestion another person made, you should, or correct them if they made a mistake, or show a better way of doing something, those are all welcome and I think appreciated but the condesending attitude is not welcome. Everyone is free to help to the extent they want to, by suggesting a general search of CPAN or specific modules or whatever.

          Condescending is exactly how I would have described the original response. Someone asked a simple question and was not told the answer, but instead berated for wasting the time of people on the forum by not bothering to have done due diligence. The irony was that the suggested path to due diligence was to search CPAN and the trouble to provide a link to the search required was gone to... But clearly the responder, a moderator on this forum, had not gone to the due diligence to verify that the suggested search would actually answer the question.

          Now, I may have taken exception to such a singularly unhelpful response and further made my opinion on it known. However, I at least did go to the trouble to run the search, find the modules, where they fell in the search results, and direct the original poster (admittedly quite late) to them.

          To say that people are free to help to the degree they are willing is all well and good. But the 'help' should actually be help, not condescending reproaches that assume laziness on the part of the original poster. Had I not already have been aware that such a module existed and a vague recollection of its name, I probably would have despaired well before reaching the 31st page of results and resorted to posting on a forum in hopes that someone knew the answer.

          Though to be honest, I may well have posed somewhere where I've found help offered in a friendly way in the past, like Perl Monks rather than here.

          Comment

          • KevinADC
            Recognized Expert Specialist
            • Jan 2007
            • 4092

            #6
            Originally posted by minowicz
            Condescending is exactly how I would have described the original response. Someone asked a simple question and was not told the answer, but instead berated for wasting the time of people on the forum by not bothering to have done due diligence. The irony was that the suggested path to due diligence was to search CPAN and the trouble to provide a link to the search required was gone to... But clearly the responder, a moderator on this forum, had not gone to the due diligence to verify that the suggested search would actually answer the question.

            Now, I may have taken exception to such a singularly unhelpful response and further made my opinion on it known. However, I at least did go to the trouble to run the search, find the modules, where they fell in the search results, and direct the original poster (admittedly quite late) to them.

            To say that people are free to help to the degree they are willing is all well and good. But the 'help' should actually be help, not condescending reproaches that assume laziness on the part of the original poster. Had I not already have been aware that such a module existed and a vague recollection of its name, I probably would have despaired well before reaching the 31st page of results and resorted to posting on a forum in hopes that someone knew the answer.

            Though to be honest, I may well have posed somewhere where I've found help offered in a friendly way in the past, like Perl Monks rather than here.
            I appreciate that you have a high standard of what you define as being helpful. A person that holds himself to a high standard personally could be a great benefit to this forum.

            But I can understand Jeffs reply also. We see many many lazy questions posted here and just like you seemed to be sensitive to his type of less than helpful reply, I can see how and why he might be sensitive to what he thinks or believes or assumes (just like you have done in regards to him) that the poster is being lazy and prefers to have others do a search when the poster could have easily done it himself. There is no end to assumption. Asking for clarification is always the better approach on a forum rather than assuming. Written words are too easily misunderstood when trying to read intentions into them that may or may not have been there.

            Anyways, I do sincerely hope you stick around here as I am assuming you are going to be helpful and look forward to reading your replies to questions. If you decide not to stick around I wish you all the best.

            Kevin

            Comment

            • Michael Rasmuss
              New Member
              • Jul 2011
              • 1

              #7
              Thank you minowicz for your post!

              I had no idea what keywords to search CPAN for this functionality.

              Comment

              • pikato
                New Member
                • Dec 2011
                • 2

                #8
                hi Rajiv,
                I'm not very sure but you may try out this cpan link


                Task::Lingua::A ny::Numbers

                Anyway c u. May u're from cit :)

                Comment

                • sathishkumar se
                  New Member
                  • Dec 2011
                  • 10

                  #9
                  Hi,

                  The following two function return the ascii value.I hope this one is useful for you........

                  $char=chr(48);
                  print"\n char= $char\n";
                  $num=ord('1');
                  print"\n Number= $num\n";

                  Comment

                  • Terry Bridges
                    New Member
                    • Mar 2012
                    • 3

                    #10
                    As a "training project", I set myself the task of converting dollar amounts into thealpha string commonly found on checks. The easiest way that I found was a series of hashes in the form:

                    %small_nums = {1 => ONE, 2 => TWO.... etc.

                    One hash for 0-9, one for the "teens" and one for the "tens" (TWENTY, THIRTY etc.)

                    Then just SPLIT the number you are converting and index reference the hashes.

                    Hope this helps.

                    Comment

                    Working...