JSPM

toflexible

1.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q22104F
  • License ISC

Convert decimals with round and specified number of fractions after continuous zeros.

Package Exports

  • toflexible
  • toflexible/index.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 (toflexible) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Install

$ npm install --save toflexible

Usage

var toFlexible = require('toflexible');

toFlexible(0.000000000234234234, 3)
// => 0.000000000234

toFlexible(0.00001201442224)  // default 2
// => 0.000012

toFlexible(12330.00000234234234, 3)
// => 12,330.000

toFlexible(25252021, 3)
// => 25,252,021.000

Description: it will return decimals with round and fixed number of fractions after continuous zero, as localized format.

Usage: cryptocurrency, DeFi, DEX, TradingView ...