diff --git a/README.md b/README.md index addc66f6..d722db96 100644 --- a/README.md +++ b/README.md @@ -132,6 +132,7 @@ five.telugu() // ఐదు five.thai() // ห้า five.turkish() // beş five.ukrainian() // п’ять +five.urdu() // پانچ five.welsh() // pump ``` @@ -197,6 +198,9 @@ five.guys(); // '🍔' ```javascript five.euro(); // '5€' five.dollar(); // '$5' +five.rupee('pakistani'); // '5 Rs.' +five.rupee('indian'); // '₹ 5' +five.rupee(); // '5 Rs.' for the default case ``` diff --git a/five.js b/five.js index 90507e66..d59f600e 100755 --- a/five.js +++ b/five.js @@ -91,6 +91,7 @@ five.turkish = function() { return 'beş'; }; five.thai = function() { return 'ห้า'; }; five.ukrainian = function() { return 'п’ять'; }; + five.urdu = function() {return 'پانچ';}; five.welsh = function() { return 'pump'; }; five.morseCode = function() { return '.....'; }; @@ -196,6 +197,14 @@ five.dollar = function() { return '$5' }; + five.rupee = function(type) { + switch (type) { + case 'pakistani': return '5 Rs.'; + case 'indian': return '₹ 5'; + default: return '5 Rs.'; + } + }; + five.rot = function(word) { if(typeof(word) != 'string') { return word; diff --git a/test.js b/test.js index 63ee6cc8..6e837901 100755 --- a/test.js +++ b/test.js @@ -77,6 +77,7 @@ assert.equal('ఐదు', five.telugu(), 'A telugu five should be ఐదు'); assert.equal('ห้า', five.thai(), 'A thai five should be ห้า'); assert.equal('beş', five.turkish(), 'A turkish five should be beş'); assert.equal('п’ять', five.ukrainian(), 'A ukrainian five should be п’ять'); +assert.equal('پانچ', five.urdu(), 'An urdu five should be پانچ'); assert.equal('.....', five.morseCode(), 'A five in morse code should be .....'); assert.equal('10', five.base(5), 'A quinary five should be 10'); @@ -142,6 +143,10 @@ assert.equal('5€', five.euro()); assert.equal('$5', five.dollar()); +assert.equal('5 Rs.', five.rupee('pakistani')); +assert.equal('₹ 5', five.rupee('indian')); +assert.equal('5 Rs.', five.rupee()); + assert.equal('5678901234', five.rot('0123456789'), 'Numbers should be rotated'); assert.equal('fghijklmnopqrstuvwxyzabcde', five.rot('abcdefghijklmnopqrstuvwxyz'), 'Small letters should be rotated'); assert.equal('FGHIJKLMNOPQRSTUVWXYZABCDE', five.rot('ABCDEFGHIJKLMNOPQRSTUVWXYZ'), 'Capital letters too');