Skip to content

Contains some util methods for converting numbers into words.

License

Notifications You must be signed in to change notification settings

yassinrahim/NumberToWords-Solidity

Repository files navigation

Number To Word Solidity Library

This library was made by refractoring the following number-to-words repository: https://github.com/marlun78/number-to-words

Contains some util methods for converting numbers into words.

Install

npm install numbertowords-solidity

Usage

API

toWords(number)

Converts an integer into words.

import "numbertowords-solidity/contracts/NumberToWords.sol";

NumberToWords.toWords(13); // => “thirteen”

NumberToWords.toWords(56); // => “fifty-six”

// Large numbers:
NumberToWords.toWords(9007199254740992); // => “nine quadrillion, seven trillion, one hundred ninety-nine billion, two hundred fifty-four million, seven hundred forty thousand, nine hundred ninety-two”

Acknowledgments

Thank You

Feel free to contact me at

LinkedIn