From f56686755e2047bec13b70e6dd8aa4c452a62c39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Feje=C5=A1?= Date: Wed, 10 Jan 2018 12:42:11 +0100 Subject: [PATCH] update snippet toDecimalMark, add test for toDecimalMark --- snippets/toDecimalMark.md | 2 +- test/toDecimalMark/toDecimalMark.test.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/snippets/toDecimalMark.md b/snippets/toDecimalMark.md index cfe6364d0..8cf4cd6c8 100644 --- a/snippets/toDecimalMark.md +++ b/snippets/toDecimalMark.md @@ -7,5 +7,5 @@ const toDecimalMark = num => num.toLocaleString('en-US'); ``` ```js -toDecimalMark(12305030388.9087); // "12,305,030,388.9087" +toDecimalMark(12305030388.9087); // "12,305,030,388.909" ``` diff --git a/test/toDecimalMark/toDecimalMark.test.js b/test/toDecimalMark/toDecimalMark.test.js index c675167e2..d1234065f 100644 --- a/test/toDecimalMark/toDecimalMark.test.js +++ b/test/toDecimalMark/toDecimalMark.test.js @@ -5,6 +5,7 @@ test('Testing toDecimalMark', (t) => { //For more information on all the methods supported by tape //Please go to https://github.com/substack/tape t.true(typeof toDecimalMark === 'function', 'toDecimalMark is a Function'); + t.equal(toDecimalMark(12305030388.9087), "12,305,030,388.909", "convert a float-point arithmetic to the Decimal mark form"); //t.deepEqual(toDecimalMark(args..), 'Expected'); //t.equal(toDecimalMark(args..), 'Expected'); //t.false(toDecimalMark(args..), 'Expected');