@thecb/components 11.5.1 → 11.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js
CHANGED
|
@@ -1691,11 +1691,15 @@ return numeral;
|
|
|
1691
1691
|
});
|
|
1692
1692
|
|
|
1693
1693
|
var noop$1 = function noop() {};
|
|
1694
|
+
var round = function round(value) {
|
|
1695
|
+
var decimals = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
1696
|
+
return Number(Math.round(Number("".concat(value, "e").concat(decimals))) + "e-".concat(decimals));
|
|
1697
|
+
};
|
|
1694
1698
|
var formatMoneyString = function formatMoneyString(s) {
|
|
1695
1699
|
return numeral(s).format("$0,0.00");
|
|
1696
1700
|
};
|
|
1697
1701
|
var convertCentsToMoneyDecimal = function convertCentsToMoneyDecimal(n) {
|
|
1698
|
-
return (n / 100
|
|
1702
|
+
return round(n / 100, 2);
|
|
1699
1703
|
};
|
|
1700
1704
|
var displayCurrency = function displayCurrency(cents) {
|
|
1701
1705
|
return formatMoneyString(convertCentsToMoneyDecimal(cents));
|
|
@@ -1869,6 +1873,7 @@ var adjustHexColor = function adjustHexColor(hex, percent, action) {
|
|
|
1869
1873
|
var general = /*#__PURE__*/Object.freeze({
|
|
1870
1874
|
__proto__: null,
|
|
1871
1875
|
noop: noop$1,
|
|
1876
|
+
round: round,
|
|
1872
1877
|
displayCurrency: displayCurrency,
|
|
1873
1878
|
convertCentsToMoneyInt: convertCentsToMoneyInt,
|
|
1874
1879
|
formatPercent: formatPercent,
|