Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<BitText Typography="BitTypography.H1">@product.Name</BitText>
</BitLink>
<BitText Typography="BitTypography.H6" Class="carousel-desc">@product.Description</BitText>
<BitText Typography="BitTypography.H4">@product.Price.ToString("C")</BitText>
<BitText Typography="BitTypography.H4">@product.FormattedPrice</BitText>

</BitStack>
</BitStack>
Expand All @@ -53,7 +53,7 @@
<ProductImage Src="@GetProductImageUrl(product)" Width="100%" />
<BitText>@product.Name</BitText>
<BitText Typography="BitTypography.Body2">@product.Description</BitText>
<BitText Typography="BitTypography.H6">@product.Price.ToString("C")</BitText>
<BitText Typography="BitTypography.H6">@product.FormattedPrice</BitText>
</BitStack>
</BitCard>
</BitLink>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
//+:cnd:noEmit
using Boilerplate.Shared.Dtos.Products;
using Boilerplate.Shared.Dtos.Statistics;
using Boilerplate.Shared.Controllers.Products;
using Boilerplate.Shared.Controllers.Statistics;

//#if(module == "Sales")
using Boilerplate.Shared.Dtos.Products;
//#endif
namespace Boilerplate.Client.Core.Components.Pages;

public partial class HomePage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<BitText Typography="BitTypography.H2">@product.Name</BitText>
<BitText Color="BitColor.Info">@product.CategoryName</BitText>
<BitText Typography="BitTypography.H6">@product.Description</BitText>
<BitText Typography="BitTypography.H4">@product.Price.ToString("C")</BitText>
<BitText Typography="BitTypography.H4">@product.FormattedPrice</BitText>
</BitStack>
</BitStack>
</BitCard>
Expand Down Expand Up @@ -95,7 +95,7 @@
<ProductImage Src="@GetProductImageUrl(prd)" Width="100%" />
<BitText>@prd.Name</BitText>
<BitText Typography="BitTypography.Body2">@prd.Description</BitText>
<BitText Typography="BitTypography.H6">@prd.Price.ToString("C")</BitText>
<BitText Typography="BitTypography.H6">@prd.FormattedPrice</BitText>
</BitStack>
</BitCard>
</BitLink>
Expand Down Expand Up @@ -141,7 +141,7 @@
<ProductImage Src="@GetProductImageUrl(prd)" Width="100%" />
<BitText>@prd.Name</BitText>
<BitText Typography="BitTypography.Body2">@prd.Description</BitText>
<BitText Typography="BitTypography.H6">@prd.Price.ToString("C")</BitText>
<BitText Typography="BitTypography.H6">@prd.FormattedPrice</BitText>
</BitStack>
</BitCard>
</BitLink>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,18 @@ public partial class ProductDto
? null
: new Uri(absoluteServerAddress, $"/api/Attachment/GetProductImage/{Id}?v={ConcurrencyStamp}").ToString();
}

public string FormattedPrice => FormatPrice();

private string FormatPrice()
{
if (CultureInfoManager.MultilingualEnabled)
{
return CultureInfo.CurrentCulture.TextInfo.IsRightToLeft
? $"{Price:N0} {CultureInfo.CurrentCulture.NumberFormat.CurrencySymbol}"
: Price.ToString("C");
}

return Price.ToString("N0");
}
}
Loading