1.5.0 • Published 11 months ago

decimal-subtract v1.5.0

Weekly downloads
-
License
ISC
Repository
github
Last release
11 months ago

Decimal Subtract v1.5.0 Documentation

Table of contents

Description

Workaround for JavaScript's decimal numbers subtraction problem.

Installation

For the usage in CJS or ESM run the following command:

npm i decimal-subtract

For script tag usage include the following script:

<!DOCTYPE html>
<html>
  <body>
    <script src="https://cdn.jsdelivr.net/npm/decimal-subtract@1.5.0/dist/decimal-subtract.min.js"></script>
  </body>
</html>

Usage example

ESM:

import { decimalSubtract } from 'decimal-subtract'

console.log(1 - 0.55) // 0.44999999999999996
console.log(decimalSubtract(1, 0.55)) // 0.45

Classic:

console.log(1 - 0.55) // 0.44999999999999996
console.log(window.decimalSubtract.decimalSubtract(1, 0.55)) // 0.45
1.5.0

11 months ago

1.2.0

1 year ago

1.1.0

1 year ago

1.3.3

1 year ago

1.3.2

1 year ago

1.4.0

1 year ago

1.3.1

1 year ago

1.3.0

1 year ago

1.0.2

2 years ago

1.0.1

2 years ago