# number-to-decimal-form-string-x

> Convert a base-10 or scientific E-notation value to a decimal form string.

Latest version **2.1.2** (published 2019-08-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install number-to-decimal-form-string-x
pnpm add number-to-decimal-form-string-x
yarn add number-to-decimal-form-string-x
bun add number-to-decimal-form-string-x
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.2 |
| Published | 2019-08-28 |
| First published | 2017-09-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=8.11.4 |
| Dependencies | 2 |
| Unpacked size | 138.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Graham Fairweather |
| Maintainers | xotic750 |
| Keywords | number, base-10, decimal, scientific, E-notation, toString, module, javascript, nodejs, browser |

## Links

- npm: https://www.npmjs.com/package/number-to-decimal-form-string-x
- Repository: https://github.com/Xotic750/number-to-decimal-form-string-x
- Issues: https://github.com/Xotic750/number-to-decimal-form-string-x/issues
- npm.io page: https://npm.io/package/number-to-decimal-form-string-x

## Dependencies (2)

- [to-string-x](https://npm.io/package/to-string-x.md) ^2.1.1
- [simple-methodize-x](https://npm.io/package/simple-methodize-x.md) ^1.0.4

## 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

- 2.1.2 (latest) — 2019-08-28
- 2.1.1 — 2019-08-20
- 2.1.0 — 2019-08-14
- 2.0.18 — 2019-07-31
- 2.0.17 — 2019-07-27
- 2.0.16 — 2019-07-27
- 2.0.15 — 2019-07-26
- 2.0.14 — 2019-07-25
- 2.0.13 — 2019-07-24
- 2.0.12 — 2019-07-24
- 2.0.11 — 2019-07-24
- 2.0.10 — 2019-07-22
- 2.0.9 — 2019-07-21
- 2.0.8 — 2019-07-19
- 2.0.7 — 2019-07-18
- … 9 more at https://npm.io/package/number-to-decimal-form-string-x/versions

## README

<a
  href="https://travis-ci.org/Xotic750/number-to-decimal-form-string-x"
  title="Travis status">
<img
  src="https://travis-ci.org/Xotic750/number-to-decimal-form-string-x.svg?branch=master"
  alt="Travis status" height="18">
</a>
<a
  href="https://david-dm.org/Xotic750/number-to-decimal-form-string-x"
  title="Dependency status">
<img src="https://david-dm.org/Xotic750/number-to-decimal-form-string-x/status.svg"
  alt="Dependency status" height="18"/>
</a>
<a
  href="https://david-dm.org/Xotic750/number-to-decimal-form-string-x?type=dev"
  title="devDependency status">
<img src="https://david-dm.org/Xotic750/number-to-decimal-form-string-x/dev-status.svg"
  alt="devDependency status" height="18"/>
</a>
<a
  href="https://badge.fury.io/js/number-to-decimal-form-string-x"
  title="npm version">
<img src="https://badge.fury.io/js/number-to-decimal-form-string-x.svg"
  alt="npm version" height="18">
</a>
<a
  href="https://www.jsdelivr.com/package/npm/number-to-decimal-form-string-x"
  title="jsDelivr hits">
<img src="https://data.jsdelivr.com/v1/package/npm/number-to-decimal-form-string-x/badge?style=rounded"
  alt="jsDelivr hits" height="18">
</a>
<a
  href="https://bettercodehub.com/results/Xotic750/number-to-decimal-form-string-x"
  title="bettercodehub score">
<img src="https://bettercodehub.com/edge/badge/Xotic750/number-to-decimal-form-string-x?branch=master"
  alt="bettercodehub score" height="18">
</a>
<a
  href="https://coveralls.io/github/Xotic750/number-to-decimal-form-string-x?branch=master"
  title="Coverage Status">
<img src="https://coveralls.io/repos/github/Xotic750/number-to-decimal-form-string-x/badge.svg?branch=master"
  alt="Coverage Status" height="18">
</a>

<a name="module_number-to-decimal-form-string-x"></a>

## number-to-decimal-form-string-x

Convert a base-10 or scientific E-notation value to a decimal form string.

<a name="exp_module_number-to-decimal-form-string-x--module.exports"></a>

### `module.exports(value)` ⇒ <code>string</code> ⏏

This method converts a base-10 or scientific E-notation value to
a decimal form string. Javascript's IEE 754 double-precision numbers
give the same precision as `number.toString()`.

**Kind**: Exported function  
**Returns**: <code>string</code> - The value converted to a decimal form string.  
**Throws**:

- <code>TypeError</code> If value is not a valid format.
- <code>TypeError</code> If value is a Symbol or not coercible.

| Param | Type                                       | Description                |
| ----- | ------------------------------------------ | -------------------------- |
| value | <code>number</code> \| <code>string</code> | The value to be converted. |

**Example**

```js
import toDecimalFormString from 'number-to-decimal-form-string-x';

toDecimalFormString(Number.MIN_SAFE_INTEGER); // '-9007199254740991'
toDecimalFormString(-0); // '-0'

let number = 0.00000000001;
number.toString(); // '1e-11'
toDecimalFormString(number); // '0.00000000001'

number = 88259496234518.57;
console.log(number.toString()); // '88259496234518.56';
console.log(toDecimalFormString(number)); // '88259496234518.56'

console.log(toDecimalFormString(Math.PI)); // '3.141592653589793'
console.log(toDecimalFormString(Number.MAX_SAFE_INTEGER)); // '9007199254740991'

console.log(toDecimalFormString('0e+0')); // '0'
console.log(toDecimalFormString('1e-11')); // '0.00000000001'
console.log(toDecimalFormString('4.062e-3')); // '0.004062'
console.log(toDecimalFormString('4.461824e+2')); // '446.1824'

toDecimalFormString(NaN); // TypeError
toDecimalFormString(' 0'); // TypeError
toDecimalFormString('0 '); // TypeError
toDecimalFormString('0.'); // TypeError
toDecimalFormString('.0'); // TypeError
toDecimalFormString('0x1'); // TypeError
toDecimalFormString('0o1'); // TypeError
toDecimalFormString('0b1'); // TypeError
toDecimalFormString('4.062 e-3'); // TypeError
toDecimalFormString('9 007 199 254 740 991'); // TypeError
toDecimalFormString('9,007,199,254,740,991'); // TypeError

toDecimalFormString(Symbol('0')); // TypeError
toDecimalFormString(Object.create(null)); // TypeError
```

---
_Source: https://npm.io/package/number-to-decimal-form-string-x · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
