x/humanity@1.5.0/mod.ts

Humanizer for Deno & NodeJS
Latest
import * as mod from "https://dotland.deno.dev/x/humanity@1.5.0/mod.ts";

Functions

create Humanity instance with custom locale

const Humanity = createCustomHumanity({
    locale: "custom",
    numbers: {
        thousand: "tis",
        million: "er",
        billion: "pe",
        trillion: "xe",
        quadrillion: "fa",
        quintillion: "ier",
    },
});

create Humanity instance with default locale

const Humanity = createHumanity('en_US');
console.log(Humanity.number(500000)); // 500 000
// Output: 500 thousand