1.1.8 • Published 9 months ago

num2talk v1.1.8

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Bridging Languages Through Number Translation – Supporting 10 Popular Languages.

num2talk Documentation

num2talk is a JavaScript package that provides functions to convert numbers into words in various languages, including English, Bengali, Hindi, Arabic, Chinese, Urdu, Portuguese, Russian, Japanese, and Spanish.

Installation

You can install num2talk via npm:

npm install num2talk

Usage

After installation, you can import the specific number-to-word functions you need in your project.

import { num2Word, num2Bangla, num2Hi } from 'num2talk';

// Example usage
console.log(num2Word(123));       // Converts to English words: "one hundred twenty-three"
console.log(num2Bangla(456));     // Converts to Bengali words: "চারশ পঁচাশি"
console.log(num2Hi(789));         // Converts to Hindi words: "सात सौ नवासी"

Language Functions Table

The following table outlines the available languages, their respective functions, and usage examples.

LanguageFunctionUsage ExampleOutput
Englishnum2Englishnum2English(12345)"twelve thousand three hundred forty-five"
Englishnum2Wordsnum2Words(12345)"twelve thousand three hundred forty-five"
Bengalinum2Banglanum2Bangla(678)"ছয়শ আটাত্তর"
Hindinum2Hindinum2Hindi(101)"एक सौ एक"
Arabicnum2Arabicnum2Arabic(345)"ثلاثمائة وخمسة وأربعون"
Chinesenum2Chinesenum2Chinese(5678)"五千六百七十八"
Urdunum2Urdunum2Urdu(901)"نو سو ایک"
Portuguesenum2Portuguesenum2Portuguese(2345)"dois mil trezentos e quarenta e cinco"
Russiannum2Russiannum2Russian(890)"восемьсот девяносто"
Japanesenum2Japanesenum2Japanese(1234)"千二百三十四"
Spanishnum2Spanishnum2Spanish(567)"quinientos sesenta y siete"

Example Usage

Here’s how to use some of the functions:

Using num2English

The num2English function takes a number as input and returns the corresponding English word.

import {num2Arabic, num2Bangla, num2Chinese, num2English, num2Hindi,num2Japanese, num2Portuguese, num2Russian, num2Spanish,num2Urdu} from 'num2talk'

const App = () => {
    const number = 12345

    console.log(num2English(number))
    console.log(num2Hindi(number))
    console.log(num2Japanese(number))
    console.log(num2Portuguese(number))
    console.log(num2Russian(number))
    console.log(num2Spanish(number))
    console.log(num2Urdu(number))
    console.log(num2Arabic(number))
    console.log(num2Bangla(number))
    console.log(num2Chinese(number))
  return (
    <div>App</div>
  )
}

export default App

Contributing

If you wish to contribute to the development of num2talk, feel free to fork the repository and submit pull requests. Ensure you follow the coding conventions and include tests for any new features you add.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements

  • Thank you to all contributors and users for your support in improving this package.

Additional Sections (if needed)

  • Changelog: Document any updates, fixes, or improvements made to the package over time.
  • FAQ: Address common questions or issues users might encounter.
  • Contributing: Provide instructions for how to contribute to the project.
  • Credits: List any third-party libraries or resources used in the package.
  • License: Include a copy of the license used for the package.
1.1.8

9 months ago

1.1.7

9 months ago

1.1.6

9 months ago

1.1.5

9 months ago

1.1.4

9 months ago

1.0.3

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago