# number-format-webcomponent

> A simple Webcomponent to format numbers automatically according to the browser language or manually. VanillaJS only

Latest version **1.0.2** (published 2019-04-27) · MIT license · 0 weekly downloads

## Install

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

## 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.2 |
| Published | 2019-04-27 |
| First published | 2019-04-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Tobias Armbruster |
| Maintainers | toarm |
| Keywords | number, format, webcomponent, vanilla |

## Links

- npm: https://www.npmjs.com/package/number-format-webcomponent
- Repository: https://github.com/toarm/number-format
- Homepage: https://toarm.github.io/number-format/demo.html
- Issues: https://github.com/toarm/number-format/issues
- npm.io page: https://npm.io/package/number-format-webcomponent

## Dependencies (1)

- [@webcomponents/webcomponentsjs](https://npm.io/package/@webcomponents/webcomponentsjs.md) ^2.1.3

## 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.2 (latest) — 2019-04-27
- 1.0.1 — 2019-04-26
- 1.0.0 — 2019-04-26

## README

# number-format-(webcomponent)
A simple ultra lightweight VanillaJS Webcomponent to display numbers including currencies.

* **No dependencies**
* **1.87 kb Source Code**
* **800 Bytes zipped**

## Usage 
Include number-format.js:
```html
    <head>
      <!-- if you want to support legacy browser add the webcomponents-loader -->
      <!-- <script src="node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script> -->
      <script type="module" src="node_modules/number-format-webcomponent/number-format.js"></script>
      ...
      
    <body>
      <number-format number="5.2136"></number-format>
```
See the [demo.html](https://toarm.github.io/number-format/demo.html) for the results.

### Default - Browser Locale
```html
<number-format number="5.2136"></number-format>
```
`Result depends on your Browser Locale. Please see `[demo.html](https://toarm.github.io/number-format/demo.html)

### British Currency Style
```html
<number-format number="5.2136" locale="en-GB" currency="GBP"></number-format>
```
`£5.21`

### German Style - Using ,
```html
<number-format number="5.2136" locale="de-DE"></number-format>
```
`5,21`

### German Currency Style
```html
<number-format number="5.2136" locale="de-DE" currency="EUR"></number-format>
```
`5,21 €`

### 4 Digits
```html
<number-format number="5.2136" min-digits="4" max-digits="4"></number-format>
```
`Result depends on your Browser Locale. Please see `[demo.html](https://toarm.github.io/number-format/demo.html)

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