From 07dfa0251a2dfa54e9bbf629d910863f97373e3d Mon Sep 17 00:00:00 2001 From: Karen Garcia dos Santos Date: Thu, 31 Oct 2019 20:26:40 +1100 Subject: [PATCH 1/2] [Issue #418] Adds Brazilian currency --- README.md | 1 + five.js | 2 ++ 2 files changed, 3 insertions(+) diff --git a/README.md b/README.md index addc66f6..b372fe6f 100644 --- a/README.md +++ b/README.md @@ -197,6 +197,7 @@ five.guys(); // '🍔' ```javascript five.euro(); // '5€' five.dollar(); // '$5' +five.real(); // 'R$5' ``` diff --git a/five.js b/five.js index 90507e66..0f73eb30 100755 --- a/five.js +++ b/five.js @@ -196,6 +196,8 @@ five.dollar = function() { return '$5' }; + five.real = function() { return 'R$5' }; + five.rot = function(word) { if(typeof(word) != 'string') { return word; From c76b6915fa6e3e3d30cde71bf30a8048d484c242 Mon Sep 17 00:00:00 2001 From: Karen Garcia dos Santos Date: Thu, 31 Oct 2019 20:29:44 +1100 Subject: [PATCH 2/2] [Issue #418] Adds test for Brazilian currency --- test.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test.js b/test.js index 63ee6cc8..284d8eef 100755 --- a/test.js +++ b/test.js @@ -142,6 +142,8 @@ assert.equal('5€', five.euro()); assert.equal('$5', five.dollar()); +assert.equal('R$5', five.real()); + 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');