update snippet toDecimalMark, add test for toDecimalMark

This commit is contained in:
Stefan Feješ
2018-01-10 12:42:11 +01:00
parent cc2b0ba05d
commit f56686755e
2 changed files with 2 additions and 1 deletions

View File

@ -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"
```

View File

@ -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');