Permalink
Browse files

Minor documentation updates

  • Loading branch information...
1 parent 5b0b95f commit ada95eeb77b1becb8e4590b9de15c22dc4b05d82 @olliebennett committed Nov 23, 2012
Showing with 49 additions and 3 deletions.
  1. +3 −3 README.md
  2. +34 −0 num2words/tools4text-num2words-fr.js
  3. +12 −0 num2words/tools4text-num2words-ne.js
View
@@ -12,8 +12,8 @@ Accepts a positive integer, and returns the text equivalent in the specified lan
num2words("en", 3015); // "three thousand and fifteen" (English)
- num2words("fr", 101); // "cent un" (French)
-
+ num2words("roman", 1999); // "MCMXCIX" (Roman Numerals)
+
See individual `tools4text-num2words-<language_code>.js` files for language-specific notes and configuration options.
### Implemented languages:
@@ -30,7 +30,7 @@ See individual `tools4text-num2words-<language_code>.js` files for language-spec
Converts a time to words, in the specified language.
-Accepts a String representation of a time, in "HH:MM" format, and returns
+Accepts a String representation of a time, in "HH:MM" format, and returns the corresponding time in words.
JavaScript `Date` objects are also accepted, and handled automatically.
@@ -0,0 +1,34 @@
+/*
+ * Convert Number to Words
+ * Language: French
+ *
+ * Example output:
+ * 21 = "vingt et un"
+ * 101 = "cent un"
+ *
+ */
+
+var tools4text = tools4text || {};
+tools4text.num2words_fr = function (number) {
+
+ "use strict";
+
+ // Language definitions
+ var lang = {
+ "lang_name": "French (Standard)",
+ "units": ["zero", "un", "deux", "trois", "quart", "cinq", "six", "sept", "huit", "neuf"],
+ "teens": ["", "onze", "douze", "treize", "quatorze", "quinze", "seize", "dix-sept", "dix-huit", "dix-neuf"],
+ "tens": ["", "dix", "vingt", "trente", "quarante", "cinquante", "soixante", "soixante-dix", "quatre-vingt", "quatre-vingt dix"],
+ "hundred": "cent",
+ "thousand": "mille",
+ "million": "MILLION", // hundred thousand?
+ "billion": "BILLION",
+ "trillion": "TRILLION",
+ "and": "et"
+ };
+
+ // STARTS HERE
+
+ return "bonjour!";
+
+};
@@ -0,0 +1,12 @@
+ "ne": {
+ "lang_name": "Nepali",
+ "units": ["sunna","ek","dui","teen","char","panch","chha","saat","aath","nau"],
+ "teens": ["","egara","bara","tera","chaunda","pandra","sora","satra","athara","unnais"],
+ "tens": ["","dus","bis","tees","chalis","pachas","satdhi","satarri","assi","nabbe"],
+ "hundred": "saye",
+ "thousand": "hajar",
+ "million": "lakh", // hundred thousand?
+ "billion": "BILLION",
+ "trillion": "trillion",
+ "and": ""
+ },

0 comments on commit ada95ee

Please sign in to comment.