# us-dollars

> Format US dollars ($)

Latest version **1.0.1** (published 2015-08-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install us-dollars
pnpm add us-dollars
yarn add us-dollars
bun add us-dollars
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2015-08-31 |
| First published | 2015-08-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Ben Drucker |
| Maintainers | bendrucker |
| Keywords | us, dollars, format |

## Links

- npm: https://www.npmjs.com/package/us-dollars
- Repository: https://github.com/bendrucker/us-dollars
- Homepage: https://github.com/bendrucker/us-dollars#readme
- Issues: https://github.com/bendrucker/us-dollars/issues
- npm.io page: https://npm.io/package/us-dollars

## Dependencies (2)

- [greatest](https://npm.io/package/greatest.md) ~1.0.2
- [precision](https://npm.io/package/precision.md) ~1.0.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2015-08-31
- 1.0.0 — 2015-08-31

## README

# us-dollars [![Build Status](https://travis-ci.org/bendrucker/us-dollars.svg?branch=master)](https://travis-ci.org/bendrucker/us-dollars)

> Format US dollars ($)


## Install

```
$ npm install --save us-dollars
```


## Usage

```js
var dollars = require('us-dollars')

dollars(5)
//=> $5.00

dollars(5, 0)
//=> $5

dollars(5.1234)
//=> $5.1234
```

## API

#### `dollars(value, [decimals])` -> `string`

##### value

*Required*  
Type: `value`

A number to format.

##### decimals

Type: `number`

A number of decimal places to use. When omitted, this defaults to 2 or the precision of `value`, whichever is greatest.


## License

MIT © [Ben Drucker](http://bendrucker.me)

---
_Source: https://npm.io/package/us-dollars · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
