1.5.0 • Published 2 years ago

decimal-subtract v1.5.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years 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

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.3.3

2 years ago

1.3.2

2 years ago

1.4.0

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.0.2

3 years ago

1.0.1

3 years ago