https://github.com/rawnly/commas
Add, Remove, Replace commas.
https://github.com/rawnly/commas
Last synced: 9 months ago
JSON representation
Add, Remove, Replace commas.
- Host: GitHub
- URL: https://github.com/rawnly/commas
- Owner: rawnly
- Created: 2017-07-08T13:27:38.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-08T13:31:18.000Z (almost 9 years ago)
- Last Synced: 2025-05-19T11:46:02.128Z (about 1 year ago)
- Language: Shell
- Size: 3.91 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Commas
> Add, Remove, Replace commas.
## Installation
To install **commas** you need
to use a **node package manager** as **npm**
or **yarn**
```bash
$ npm install commas --save
# YARN
$ yarn add commas
```
## Usage
See more in the `example` folder
```js
const cm = require('commas');
let n = {
wComma: "1,000,000",
nComma: 1000000
}
n = cm.add(number.nComma);
//=> 1000000 to "1000000"
// return string
n = cm.remove(number.wComma);
//=> "1,000,000" to 1000000
// return number
n = cm.replace(number.wComma);
//=> "1,000,000" to 1.000.000
// return number
```