Fix math bug

This commit is contained in:
Ace Nassri 2018-06-22 15:44:50 -07:00
parent 1fa7b44c83
commit 97a36a6374

View file

@ -55,7 +55,7 @@ function _getCurrencyData (callback) {
*/
function _carry (amount) {
amount.fractional += (amount.decimal % 1) * 100;
amount.decimal = Math.floor(amount.decimal + amount.fractional / 100);
amount.decimal = Math.floor(amount.decimal) + Math.floor(amount.fractional / 100);
amount.fractional = amount.fractional % 100;
return amount;
}