btrz-mathematics
Advanced tools
Comparing version 1.3.0 to 1.4.0
"use strict"; | ||
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } | ||
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } | ||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } | ||
@@ -113,2 +113,5 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } | ||
} | ||
if (roundingPolicy === "nocents") { | ||
return wholePlusDigits(whole); | ||
} | ||
if (digits == 0) { | ||
@@ -115,0 +118,0 @@ flip = cents.substr(digits, 1); |
{ | ||
"name": "btrz-mathematics", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "Betterez Mathematics", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -96,2 +96,6 @@ "use strict"; | ||
if (roundingPolicy === "nocents") { | ||
return wholePlusDigits(whole); | ||
} | ||
if (digits == 0) { | ||
@@ -98,0 +102,0 @@ flip = cents.substr((digits), 1); |
@@ -96,2 +96,10 @@ "use strict"; | ||
it("should round without decimals and down", function () { | ||
expect(mathematics.roundMoney(1069567, 0, "nocents")).to.be.eql("10.00"); | ||
}); | ||
it("should round without decimals and down", function () { | ||
expect(mathematics.roundMoney(1019567, 0, "nocents")).to.be.eql("10.00"); | ||
}); | ||
it("should round with decimals a less than zero non round value", function () { | ||
@@ -98,0 +106,0 @@ expect(mathematics.roundMoney(49567)).to.be.eql("0.50"); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
86697
823