JSPM

@writetome51/get-with-decimal-shifted

3.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q35199F
  • License MIT

Takes number and returns it with decimal shifted by a given number places

Package Exports

  • @writetome51/get-with-decimal-shifted

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 (@writetome51/get-with-decimal-shifted) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

getWithDecimalShifted(
       num,
       numPlacesToMoveDecimal
): number

Returns num with decimal shifted by numPlacesToMoveDecimal.
numPlacesToMoveDecimal can be negative (to move the decimal left) or positive
(to move the decimal right).

Examples

getWithDecimalShifted(111.2345,  1);
    // --> 1112.345

getWithDecimalShifted(111.2345,  2);
    // --> 11123.45
 
 getWithDecimalShifted(1112345,  -1);
    // --> 111234.5
 
 getWithDecimalShifted(1112345,  -2);
    // --> 11123.45

Installation

npm i @writetome51/get-with-decimal-shifted

Loading

import { getWithDecimalShifted } from '@writetome51/get-with-decimal-shifted';