Skip to content

Commit 321e800

Browse files
Don't round shop admin input for measures & weights
1 parent 5573cc7 commit 321e800

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/Libraries/SmartStore.Services/Catalog/ProductExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ public static string GetBasePriceInfo(this Product product,
377377
{
378378
var value = Convert.ToDecimal((productPrice / product.BasePriceAmount) * product.BasePriceBaseAmount);
379379
var valueFormatted = priceFormatter.FormatPrice(value, true, currency);
380-
var amountFormatted = Math.Round(product.BasePriceAmount.Value, 2).ToString("G29");
380+
var amountFormatted = product.BasePriceAmount.Value.ToString("G29");
381381
var infoTemplate = localizationService.GetResource("Products.BasePriceInfo");
382382

383383
var result = infoTemplate.FormatInvariant(

src/Presentation/SmartStore.Web/Controllers/CatalogHelper.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,10 +1193,10 @@ public ProductDetailsModel PrepareProductDetailModel(
11931193
}
11941194
}
11951195

1196-
model.Weight = (model.WeightValue > 0) ? "{0} {1}".FormatCurrent(model.WeightValue.ToString("N2"), _measureService.GetMeasureWeightById(_measureSettings.BaseWeightId).SystemKeyword) : "";
1197-
model.Height = (product.Height > 0) ? "{0} {1}".FormatCurrent(product.Height.ToString("N2"), dimension) : "";
1198-
model.Length = (product.Length > 0) ? "{0} {1}".FormatCurrent(product.Length.ToString("N2"), dimension) : "";
1199-
model.Width = (product.Width > 0) ? "{0} {1}".FormatCurrent(product.Width.ToString("N2"), dimension) : "";
1196+
model.Weight = (model.WeightValue > 0) ? "{0} {1}".FormatCurrent(model.WeightValue.ToString("G29"), _measureService.GetMeasureWeightById(_measureSettings.BaseWeightId).SystemKeyword) : "";
1197+
model.Height = (product.Height > 0) ? "{0} {1}".FormatCurrent(product.Height.ToString("G29"), dimension) : "";
1198+
model.Length = (product.Length > 0) ? "{0} {1}".FormatCurrent(product.Length.ToString("G29"), dimension) : "";
1199+
model.Width = (product.Width > 0) ? "{0} {1}".FormatCurrent(product.Width.ToString("G29"), dimension) : "";
12001200

12011201
if (productBundleItem != null)
12021202
{

0 commit comments

Comments
 (0)