Skip to content

Commit

Permalink
v1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
cn0047 committed Jun 20, 2018
1 parent f56bfc5 commit 11f33d7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ short-string-number
[![CircleCI](https://circleci.com/gh/cn007b/short-string-number.svg?style=svg)](https://circleci.com/gh/cn007b/short-string-number)
[![Maintainability](https://api.codeclimate.com/v1/badges/acb8351b4e4c5b91fea8/maintainability)](https://codeclimate.com/github/cn007b/short-string-number/maintainability)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/fc344c605a2740fe8e8257fc875e94ca)](https://www.codacy.com/app/cn007b/short-string-number)
[![Coverage Status](https://coveralls.io/repos/github/cn007b/short-string-number/badge.svg?branch=master)](https://coveralls.io/github/cn007b/short-string-number?branch=master)

Convert number into short string.

-

## Installation

`yarn add short-string-number`
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "short-string-number",
"version": "1.0.0",
"version": "1.0.1",
"license": "MIT",
"author": "Vladimir Kovpak <cn007b@gmail.com>",
"homepage": "https://github.com/cn007b/short-string-number#readme",
"description": "",
"description": "Convert number into short string (like 41939 to 41.9k).",
"main": "src/shortStringNumber.js",
"scripts": {
"test": "node_modules/mocha/bin/_mocha --recursive --reporter spec test/unit",
Expand Down
8 changes: 8 additions & 0 deletions test/unit/shortStringNumber.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ const assert = require('assert');
const ssn = require('./../../src/shortStringNumber');

describe('Test suite for: `shortStringNumber`.', () => {
describe('Invalid value:', () => {
it('1', () => assert.strictEqual(ssn(true), true));
});

describe('<= 1e4:', () => {
it('1', () => assert.strictEqual(ssn(1024), 1024));
it('2', () => assert.strictEqual(ssn(8084), 8084));
Expand All @@ -22,4 +26,8 @@ describe('Test suite for: `shortStringNumber`.', () => {
it('2', () => assert.strictEqual(ssn(1039183), '1.04m'));
it('3', () => assert.strictEqual(ssn(22051000), '22.05m'));
});

describe('Way big number:', () => {
it('1', () => assert.strictEqual(ssn(1222333444555666), 1222333444555666));
});
});

0 comments on commit 11f33d7

Please sign in to comment.