-6

Can anybody give me a primer code I could work on in converting numbers into words? I search the code and I get it but there is no code or answer what I want. for example: The number 1101011101. I want to convert it to:

  • One billion One hundred One million and Eleven Thousand One hundred and one
  • 110 Crore 10 Lakh 11 Thousand One hundred and one
  • 1 Arab 10 Crore 10 Lakh and 11 Thousand One hundred and one

Please help me to generate this code.I want both ways in one function text-box return value to label.on text-changed event Thanks

James Z
  • 12,209
  • 10
  • 24
  • 44
M.Umer
  • 1
  • 3
  • 3
    if anyone answers this, you'll have achieved maximum output for minimum input, just like your bio states... – user1666620 May 27 '16 at 14:27
  • 1
    This isn't a code writing service. What have you tried. Where are you stuck? Look at the dupe and you should be able to adapt it pretty easily. – Matt Burland May 27 '16 at 14:30
  • I give you all detail, you don't understand what I am saying? – M.Umer May 27 '16 at 15:05
  • user1666620 you write this is duplicate question . then give me the link who ask this type of question.I am saying to convert it. 1101011101 = 1 Arab 10 Crore 10 Lakh and 11 Thousand One hundred and one – M.Umer May 27 '16 at 15:07
  • If you want me to give you code tell me. – M.Umer May 27 '16 at 15:13

1 Answers1

2

You can use the Humanizr library for this.

Example:

1.ToWords() => "one"
10.ToWords() => "ten"
11.ToWords() => "eleven"
122.ToWords() => "one hundred and twenty-two"
3501.ToWords() => "three thousand five hundred and one"

Supports cultures:

1.ToWords(GrammaticalGender.Masculine, new CultureInfo("ru")) => "один"
Jamie Rees
  • 7,973
  • 2
  • 45
  • 83