0

After Taking Numbers From Users e:g (1,2,3,4) how can I convert them into text e:g(One, Two, Three) Pardon if If not specific in my question

I Wanted tio use Switch but I Think I do need some Automation like if Someone type 1005 he'll get a return of one thousand and five

  • You need to write a complex algorithm to do it – flyingfox Nov 19 '22 at 10:27
  • 1
    Does this answer your question? [JavaScript numbers to Words](https://stackoverflow.com/questions/5529934/javascript-numbers-to-words) – Emre Nov 19 '22 at 10:38
  • Another option in terms of npm libraries is https://www.npmjs.com/package/n2words. No dependencies and it's currently maintained. – HereBeAndre Nov 19 '22 at 10:40

2 Answers2

0

Try this npm package: https://www.npmjs.com/package/number-to-words and see if it satisfies you problem

Bhavya Dhiman
  • 282
  • 2
  • 15
0

you can use a package as mentioned above, or you can use this as well

[Codepen](https://codepen.io/saqib1144/pen/vbGEyd)
ShimiBK
  • 1
  • 1