Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ruanyl/nformat
format string/number
https://github.com/ruanyl/nformat
Last synced: 18 days ago
JSON representation
format string/number
- Host: GitHub
- URL: https://github.com/ruanyl/nformat
- Owner: ruanyl
- License: mit
- Created: 2015-09-09T21:26:48.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-10T16:57:56.000Z (over 9 years ago)
- Last Synced: 2024-11-05T14:55:49.183Z (2 months ago)
- Language: JavaScript
- Size: 121 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
nformat
========
[![build status](https://secure.travis-ci.org/ruanyl/nformat.svg)](http://travis-ci.org/ruanyl/nformat)
[![NPM version](https://badge.fury.io/js/nformat.svg)](http://badge.fury.io/js/nformat)simple number/string format
## Installation
This module is installed via npm:
``` bash
$ npm install nformat
```## Example Usage
``` js
var nFormat = require('nformat');
assert.equal(nFormat(12345678, '***-***:*** *'), '123-456:78');
assert.equal(nFormat(123456789, '***-***-***'), '123-456-789');
```