New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

ollo-utils

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ollo-utils

### Format

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

Usage

Format

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

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

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

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

Text

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

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

Keywords

1.0.0

FAQs

Package last updated on 25 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts