# ollo-utils

> ### Format

Latest version **1.0.0** (published 2023-07-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install ollo-utils
pnpm add ollo-utils
yarn add ollo-utils
bun add ollo-utils
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2023-07-25 |
| First published | 2023-07-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 6 |
| Unpacked size | 57.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | OLLO Station |
| Maintainers | thomasstation |
| Keywords | 1.0.0 |

## Links

- npm: https://www.npmjs.com/package/ollo-utils
- Repository: https://github.com/OllO-Station/ollo-utils
- Homepage: https://github.com/OllO-Station/ollo-utils#readme
- Issues: https://github.com/OllO-Station/ollo-utils/issues
- npm.io page: https://npm.io/package/ollo-utils

## Dependencies (6)

- [ramda](https://npm.io/package/ramda.md) ^0.27.1
- [numeral](https://npm.io/package/numeral.md) ^2.0.6
- [@types/ramda](https://npm.io/package/@types/ramda.md) ^0.27.57
- [bignumber.js](https://npm.io/package/bignumber.js.md) ^9.0.1
- [tiny-warning](https://npm.io/package/tiny-warning.md) ^1.0.3
- [@types/numeral](https://npm.io/package/@types/numeral.md) ^2.0.2

## Recent versions

- 1.0.0 (latest) — 2023-07-25

## README

## Usage

### Format

```ts
import { readAmount, readDenom, readPercent, toAmount } from "@ollo/ollo-utils"

readAmount("1234567890") // "1234.56789"
readAmount("1234567890", { decimals: 0 }) // "1234567890"
readAmount("1234567890", { fixed: 6 }) // "1234.567890"
readAmount("1234567890", { comma: true }) // "1,234.56789"
readAmount("1234567890", { integer: true }) // "1234"
readAmount("1234567890", { prefix: true }) // "1.23K"

toAmount("1234.56789") // "1234567890"
toAmount("1234", { decimals: 0 }) // "1234"

readDenom("uollo") // "Luna"
readDenom("uusd") // "UST"

readPercent("1.23") // "123.00%"
readPercent("1.23", { fixed: 3 }) // "123.000%"
```

### Is

```ts
import { isDenom, isDenomTerra } from "@ollo/ollo-utils"

isDenomOllo("uusd") // true
isDenomOllo("uollo") // false

isDenom("uusd") // true
isDenom("uollo") // true
```

### Text

```ts
import { truncate } from "@ollo/ollo-utils"

truncate("ollo1x46rqay4d3cssq8gxxvqz8xt6nwlz4td20k38v") // "ollo1...20k38v"
truncate("ollo1x46rqay4d3cssq8gxxvqz8xt6nwlz4td20k38v", [6, 3]) // "ollo1...38v"
```

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