numbertowords-solidity
v1.1.1
Published
Utility method to convert numbers into words in english.
Downloads
6
Readme
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