letters-fr_be_ch-to-numbers
v0.0.3
Published
A lightweight JavaScript library that transforms letters to numbers, supporting the French, Belgian, and Swiss naming.
Downloads
7
Maintainers
Readme
letters-fr_be_ch-to-numbers
A lightweight JavaScript library that parses text into numbers, supporting the French, Belgian, and Swiss number formats.
Getting started
Package installation
Installation:
npm install letters-fr_be_ch-to-numbersExamples
getNumbersFrom('quatre-vingt-dix-neuf'); // 99
getNumbersFrom('nonante neuf'); // 99
getNumbersFrom('mille huitante neuf'); // 1089
getNumbersFrom('moins cent vingt-trois'); // -123
getNumbersFrom('zéro virgule zéro zéro un'); // 0.001
getNumbersFrom('Quatre cent vingt et un mille cinq cent trente-sept'); // 421537
// if you wish to pass a custom separator (default support: "virgule", ",", "euros")
getNumbersFrom('cinquante et un dollars et trente centimes', 'dollars'); // 51.3File a bug, got a new idea, or want to contribute?
Feel free! Open a ticket.
Changelog
0.0.2: Support for ending sentence with 'cents'.
0.0.3: Support for ending sentence with 'cent'.
Discover others libraries
All libraries are permanently supported. Discover them here.
