# tofixed

> Converts a number into a string, keeping a specified number of decimals.

Latest version **1.0.0** (published 2016-04-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install tofixed
pnpm add tofixed
yarn add tofixed
bun add tofixed
```

## 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.0 |
| Published | 2016-04-23 |
| First published | 2016-04-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | bubkoo |
| Maintainers | bubkoo |
| Keywords | tofixed, fixed, precision, number, convert, converter |

## Links

- npm: https://www.npmjs.com/package/tofixed
- Repository: https://github.com/gearcase/tofixed
- Homepage: https://github.com/gearcase/tofixed#readme
- Issues: https://github.com/gearcase/tofixed/issues
- npm.io page: https://npm.io/package/tofixed

## Alternatives

- [random-seedable](https://npm.io/package/random-seedable.md) — 27.9K weekly downloads
- [n2words](https://npm.io/package/n2words.md) — 22.2K weekly downloads
- [@stdlib/math-base-special-factorialln](https://npm.io/package/@stdlib/math-base-special-factorialln.md) — 5.7K weekly downloads
- [@stdlib/math-base-special-abs2](https://npm.io/package/@stdlib/math-base-special-abs2.md) — 1.7K weekly downloads
- [commons-math-interpolation](https://npm.io/package/commons-math-interpolation.md) — 1.4K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2016-04-23

## README

# toFixed

> Converts a number into a string, keeping a specified number of decimals.


[![MIT License](https://img.shields.io/badge/license-MIT_License-green.svg?style=flat-square)](https://github.com/gearcase/tofixed/blob/master/LICENSE)

[![build:?](https://img.shields.io/travis/gearcase/toFixed/master.svg?style=flat-square)](https://travis-ci.org/gearcase/toFixed)
[![coverage:?](https://img.shields.io/coveralls/gearcase/toFixed/master.svg?style=flat-square)](https://coveralls.io/github/gearcase/toFixed)


## Install

```
$ npm install --save tofixed
```

## Usage

```js
var toFixed = require('tofixed');

// API
// - toFixed(number, precision)

toFixed(5.56789, 2);
// => '5.57'
```

Note: it will return a fixed number of *at most* `precision` digits after the decimal. 


## Contributing

Pull requests and stars are highly welcome.

For bugs and feature requests, please [create an issue](https://github.com/gearcase/tofixed/issues/new).

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