UNPKG

tn-numpad

Version:

Leading zeroes to a number

31 lines (23 loc) 706 B
import { assert } from 'chai' import { numpad } from '../src/index' describe('toFixed(2)', function () { it (`numpad(-25.7799,4,'x',2)`, function(){ assert.equal(numpad(-25.7799,4,'x',2), '-xx25.78') }) describe('Positive', function(){ it('numpad(25, 4)', function () { assert.equal(numpad(25, 4), '0025') }) it('numpad(25309, 4)', function () { assert.equal(numpad(25309, 4), '25309') }) }) describe('Negative', function(){ it('numpad(-25, 4)', function () { assert.equal(numpad(-25, 4), '-0025') }) it('numpad(-25309, 4)', function () { assert.equal(numpad(-25309, 4), '-25309') }) }) })