1.0.5 • Published 2 months ago

react-number-to-words v1.0.5

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

React Number to Words

This is a React-based npm package that translates/converts numbers into words. It allows developers to easily integrate this functionality into their React applications. This package will help to convert number or amounts into words form.

Installation

npm install react-number-to-words

Usage

  1. Import the convertToWords function from the package:
import {convertToWords} from 'react-number-to-words';
  1. Call the convertToWords function with a number as an argument:
const number = 123;
const words = convertToWords(number);
console.log(words); // Output: "One Hundred and Tweenty Three"
  1. (Optional) Use the provided React components for user input and display:
import {NumberInput, NumberDisplay} from 'react-number-to-words';
  1. Call the toOrdinal function with a number as an argument:
const number = 123;
const ordinal = toOrdinal(number);
console.log(ordinal); // Output: "123th"

Features

  • Converts numbers up to trillions into words.
  • Supports custom number formatting (currently not implemented, but can be added in the future).

Contributing

Feel free to submit pull requests for bug fixes, improvements, or new features. We welcome community contributions.

License

This package is licensed under the MIT License.

1.0.5

2 months ago

1.0.4

3 months ago

1.0.3

3 months ago

1.0.2

3 months ago

1.0.1

3 months ago

1.0.0

3 months ago