Skip to content

Commit 7eaf1ad

Browse files
authored
fix: parse string values transaction attributes to numbers (#81)
1 parent 8d1e9a7 commit 7eaf1ad

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

js/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,17 +346,17 @@ class TransactionAttributes {
346346
}
347347

348348
setRevenue (revenue) {
349-
this.revenue = revenue
349+
this.revenue = typeof revenue === 'string' ? parseFloat(revenue) : revenue
350350
return this
351351
}
352352

353353
setShipping (shipping) {
354-
this.shipping = shipping
354+
this.shipping = typeof shipping === 'string' ? parseFloat(shipping) : shipping
355355
return this
356356
}
357357

358358
setTax (tax) {
359-
this.tax = tax
359+
this.tax = typeof tax === 'string' ? parseFloat(tax) : tax
360360
return this
361361
}
362362

0 commit comments

Comments
 (0)