JSPM

decimal-adjust

0.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 22
  • Score
    100M100P100Q52526F
  • License MIT

Decimal adjustment of a number.

Package Exports

  • decimal-adjust

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

Readme

decimal-adjust.js

Decimal adjustment of a number.

Install

npm install decimal-adjust

API

decimalAdjust(type, value, exp)

Params

  • type (String) The type of adjustment.
  • value (Number) The number.
  • exp (Integer) The exponent (the 10 logarithm of the adjustment base).

Returns

  • (Number) The adjusted value.

Example

var decimalAdjust = require('decimal-adjust');

Math.round10 = function(value, exp) {
  return decimalAdjust('round', value, exp);
};

Math.floor10 = function(value, exp) {
  return decimalAdjust('floor', value, exp);
};

Math.ceil10 = function(value, exp) {
  return decimalAdjust('ceil', value, exp);
};