💡
util-stunks
  • 📑util-stunks
  • 🕯️Funções
    • 👀abbreviate
    • 🎱randomArray
    • ⏱️relativeTime
    • 🚀unabbreviate
    • ⏲️msToTime
  • 🔝Types
    • AbbreviationOptions
    • OptionsRandomArray
    • TimeOptions
Powered by GitBook
On this page
  • Tipos:
  • Exemplo de uso
  1. Funções

abbreviate

Retorna uma versão abreviada do mesmo com sufixos de unidade (mil, milhão, bilhão, etc).

Previousutil-stunksNextrandomArray

Last updated 1 year ago

Tipos:

Parâmetros

  1. input:

  2. options?:

Retorno

Exemplo de uso

const { abbreviate } = require("util-stunks");

abbreviate(100) // 100
abbreviate(1555400) // 1.5M
abbreviate(1555400, { display: 0 }); // 1M
abbreviate(1555400, { display: 2 }); // 1.55m
abbreviate(1555400, { round: true }); // 2M
import { abbreviate } from "util-stunks";

abbreviate(100) // 100
abbreviate(1555400) // 1.5M
abbreviate(1555400, { display: 0 }); // 1M
abbreviate(1555400, { display: 2 }); // 1.55m
abbreviate(1555400, { round: true }); // 2M
import { abbreviate } from "util-stunks";

abbreviate(100) // 100
abbreviate(1555400) // 1.5M
abbreviate(1555400, { display: 0 }); // 1M
abbreviate(1555400, { display: 2 }); // 1.55m
abbreviate(1555400, { round: true }); // 2M
🕯️
👀
number
AbbreviateOptions
string