@trafilea/afrodita-components 6.8.8 → 6.8.9

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/build/index.js CHANGED
@@ -5511,7 +5511,7 @@ var templateObject_1$1F, templateObject_2$14, templateObject_3$T;
5511
5511
  var FinalPriceStyledContainer$1 = newStyled.div(templateObject_1$1E || (templateObject_1$1E = __makeTemplateObject(["\n display: flex;\n"], ["\n display: flex;\n"])));
5512
5512
  var PriceLabelV2 = function (_a) {
5513
5513
  var _b;
5514
- var finalPrice = _a.finalPrice, originalPrice = _a.originalPrice, discount = _a.discount, clubOffer = _a.clubOffer, color = _a.color, testId = _a.testId, _c = _a.originalPriceStyled, originalPriceStyled = _c === void 0 ? false : _c, _d = _a.originalPriceUnderlined, originalPriceUnderlined = _d === void 0 ? true : _d, _e = _a.size, size = _e === void 0 ? exports.ComponentSize.Small : _e, _f = _a.bordersRounded, bordersRounded = _f === void 0 ? false : _f, _g = _a.savingsDisplay, savingsDisplay = _g === void 0 ? true : _g, pricePerItem = _a.pricePerItem, rest = __rest(_a, ["finalPrice", "originalPrice", "discount", "clubOffer", "color", "testId", "originalPriceStyled", "originalPriceUnderlined", "size", "bordersRounded", "savingsDisplay", "pricePerItem"]);
5514
+ var finalPrice = _a.finalPrice, originalPrice = _a.originalPrice, discount = _a.discount, clubOffer = _a.clubOffer, color = _a.color, testId = _a.testId, _c = _a.originalPriceStyled, originalPriceStyled = _c === void 0 ? false : _c, _d = _a.originalPriceUnderlined, originalPriceUnderlined = _d === void 0 ? true : _d, _e = _a.size, size = _e === void 0 ? exports.ComponentSize.Small : _e, _f = _a.bordersRounded, bordersRounded = _f === void 0 ? false : _f, _g = _a.savingsDisplay, savingsDisplay = _g === void 0 ? true : _g, pricePerItem = _a.pricePerItem, _h = _a.hasRoundedSavings, hasRoundedSavings = _h === void 0 ? true : _h, rest = __rest(_a, ["finalPrice", "originalPrice", "discount", "clubOffer", "color", "testId", "originalPriceStyled", "originalPriceUnderlined", "size", "bordersRounded", "savingsDisplay", "pricePerItem", "hasRoundedSavings"]);
5515
5515
  var theme = useTheme();
5516
5516
  var productFinalPrice = pricePerItem ? pricePerItem : finalPrice;
5517
5517
  var isDiffFinalAndOriginalPrice = originalPrice !== productFinalPrice;
@@ -5549,12 +5549,14 @@ var PriceLabelV2 = function (_a) {
5549
5549
  finalPriceNum = typeof productFinalPrice === 'number' ? productFinalPrice : 0;
5550
5550
  }
5551
5551
  var saveto = originalPriceNum - finalPriceNum;
5552
- var decimalPart = Number((saveto - Math.floor(saveto)).toFixed(2));
5553
- if (decimalPart >= 0.01 && decimalPart < 0.5) {
5554
- saveto = Math.floor(saveto) + 0.0;
5555
- }
5556
- else if (decimalPart >= 0.51 && decimalPart < 1.0) {
5557
- saveto = Math.floor(saveto) + 0.5;
5552
+ if (hasRoundedSavings) {
5553
+ var decimalPart = Number((saveto - Math.floor(saveto)).toFixed(2));
5554
+ if (decimalPart >= 0.01 && decimalPart < 0.5) {
5555
+ saveto = Math.floor(saveto) + 0.0;
5556
+ }
5557
+ else if (decimalPart >= 0.51 && decimalPart < 1.0) {
5558
+ saveto = Math.floor(saveto) + 0.5;
5559
+ }
5558
5560
  }
5559
5561
  var savetoString = saveto.toFixed(2);
5560
5562
  var OriginalPrice = function () { return (jsxRuntime.jsx(Price, __assign$1({ size: originalPriceStyled ? size : exports.ComponentSize.Small, color: theme.component.pricing.priceLabel.price.originalPriceColor ||