Retorna uma versão abreviada do mesmo com sufixos de unidade (mil, milhão, bilhão, etc).
Parâmetrosinput: numberoptions?: AbbreviateOptionsRetornostring
Parâmetros
input: number
options?: AbbreviateOptions
Retorno
string
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
Last updated 2 months ago