# js-number-format

> Conjunto de funciones javascript para mostrar números con formato

Latest version **0.1.0** (published 2018-07-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install js-number-format
pnpm add js-number-format
yarn add js-number-format
bun add js-number-format
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2018-07-25 |
| First published | 2018-07-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Lester Fibla Saavedra |
| Maintainers | lesterfibla |
| Keywords | js, javascript, number_format, phpjs |

## Links

- npm: https://www.npmjs.com/package/js-number-format
- Repository: https://github.com/lesterfibla/js-number-format
- Homepage: https://github.com/lesterfibla/js-number-format#readme
- Issues: https://github.com/lesterfibla/js-number-format/issues
- npm.io page: https://npm.io/package/js-number-format

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.1.0 (latest) — 2018-07-25

## README

# JS Number Format

Conjunto de funciones javascript para mostrar números formateados (número sin decimal, con decmal y moneda)

Creado por [Lester Fibla Saavedra](https://lesterfibla.com/pro) para el curso de "Fundamentos de Javascript" de [Platzi](https://platzi.com)

## Funciones que contiene

- n(número [,truncate]), número sin decimales
- d(numero [,truncate]), número con 2 decimales
- m(numero [,truncate]), número sin decimales y signo $ al inicio
- El parámetro opcional truncate, cuando es true, corta el número entero y no lo redondea.

## Instalación

```
npm install js-number-format
```

## Uso

Llamar el script donde se quiera usar:

```
<script src="your/path/to/dist/js-number-format.js"></script>
```

y usar:

```
let numero = 123456.78;
console.log('Entrada: ' + numero);
console.log('n round: ' + n(numero) );
console.log('n trunc: ' + n(numero, true) );
console.log('d round: ' + d(numero) );
console.log('d trunc: ' + d(numero, true) );
console.log('m round: ' + m(numero) );
console.log('m trunc: ' + m(numero, true) );
```

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