1.0.3 • Published 1 year ago

react-number-shortner v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

react-number-shortner

react-number-shortner is a React package that converts numbers into a formatted string with the appropriate symbol (k, m, b) based on the magnitude of the number.

Installation

npm install react-number-shortner

Usage

To use the package in your project, import the NumberShortener function from the package:

import React from "react";
import NumberShortener  from "react-number-shortner";

function App() {
  return (
    <div>
      <NumberShortener number={12345} /> // Output: 12.3k
    </div>
  );
}

export default App;

API

The NumberShortener function takes a single argument - the number to be formatted - and returns a string with the formatted number.

numberFormat(number: number): string;
1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago