Parses raw numbers into a human language.
import say from 'SayThisNumber';
say.thisNumber(37).in('english'); // => 'thirty seven'
say.thisNumber(52).in('russian'); // => пятьдесят два'
Ranges:
import say from 'SayThisNumber';
say.thisNumberRange(3,1).in('spanish'); // => [ 'tres', 'dos', 'uno' ]
Multiple numbers:
import say from 'SayThisNumber';
say.theseNumbers([33, 91]).in('icelandic') // => [ 'þrettán', 'níutíu og einn' ]
In the browser there is an exposed say
object with the same API.
Always seeking pull requests for new languages!
- Write your number parser in
src/parsers/
and export your parse function which takes a number and returns the number parsed in the language. Be sure to support negative numbers and follow the ESLint rules.. - Add the parser to
languages.js
with [language] as the key. Keep this list alphabetical. - Test it out.
- Add your name to the authors list.
- Submit a pull request.
MIT