JSPM

@jalato/abbreviate

1.1.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 21
  • Score
    100M100P100Q60693F
  • License MIT

abbreviation is libary is used to shorten number to understable string

Package Exports

  • @jalato/abbreviate
  • @jalato/abbreviate/app.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@jalato/abbreviate) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

abbreviation

Abbreviation libary is used to abbreviate long numbers to string 1000 => 1k

install libary

using npm

 npm i @jalato/abbreviate

using yarn

yarn add @jalato/abbreviate

examples of abbreviate libary

import abbreviate from "@jalato/abbreviate";
// 1.23M 
abbreviate(1234567,false,2)

importing

import abbreviate from "@jalato/abbreviate";

arguments

// takes 3 arguments abbreviate(number,maxPlace,forPlace,forceLetter)
/*
  { 
     number:Number,
     maxPlace:number | Boolean,
     forcePlace:number | Boolean,
     forceLetter:number | Boolean
  }
*/
abbreviate(number,Boolean,Boolean,Boolean)

bytes conversion part

import { byteConversion } from "@jalato/abbreviate";
const Data = byteConversion(1580)
console.log(Data)
// 1.58 KB