Skip to content
This repository was archived by the owner on Sep 8, 2021. It is now read-only.

Commit 0bb096f

Browse files
committed
Handle fixed discount amount as string
1 parent 4242ce2 commit 0bb096f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gocommerce-js",
3-
"version": "3.7.1",
3+
"version": "3.7.2",
44
"description": "GoCommerce API client for JavaScript",
55
"main": "lib/index.js",
66
"files": [

src/calculator.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function couponValidFor(claims, coupon, item) {
3636

3737
function fixedAmount(amounts, currency) {
3838
const fixed = amounts && amounts.filter((amount) => amount.currency === currency)[0];
39-
return (fixed && fixed.amount) || 0;
39+
return (fixed && Math.round(parseFloat(fixed.amount) * 100)) || 0;
4040
}
4141

4242
function calculateDiscount(amountToDiscount, taxes, percentage, fixed, includeTaxes) {

0 commit comments

Comments
 (0)