# percent-string

> Create percentage strings for CSS properties

Latest version **0.1.0** (published 2014-07-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install percent-string
pnpm add percent-string
yarn add percent-string
bun add percent-string
```

## 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 | 2014-07-13 |
| First published | 2014-07-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Kai Davenport |
| Maintainers | binocarlos |
| Keywords | percent, css, string |

## Links

- npm: https://www.npmjs.com/package/percent-string
- Repository: https://github.com/binocarlos/percent-string
- Issues: https://github.com/binocarlos/percent-string/issues
- npm.io page: https://npm.io/package/percent-string

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2014-07-13
- 0.0.3 — 2014-07-09
- 0.0.2 — 2014-07-09
- 0.0.1 — 2014-07-09

## README

percent-string
==============

create '%' appended strings for settings CSS properties

## installation

npm:

```
$ npm install percent-string
```

component:

```
$ component install binocarlos/percent-string
```

## usage

Use this module to convert numbers into percent strings

```js
var percent = require('percent-string')

document.querySelector('#thing').style.left = percent(24)
document.querySelector('#thing').style.top = percent('24%')
```

## api

### `var string = percent(value, max)`

returns a string of the form: [num] + '%' regardless of the input type.

The zero value is '0%'

max indicates the scale so you can do 0.4 = 40%

```js
var st = percent(.4, 1)

// st = '40%'
```

### license

MIT

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