From ed9fe4902baa49f5796a9d163c5bf1ea0e4165f9 Mon Sep 17 00:00:00 2001 From: Ricardo Carneiro Date: Tue, 9 Sep 2025 22:10:18 -0300 Subject: [PATCH] fix: casas decimais --- src/BCards.Web/Controllers/PaymentController.cs | 3 ++- src/BCards.Web/Views/Payment/ManageSubscription.cshtml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/BCards.Web/Controllers/PaymentController.cs b/src/BCards.Web/Controllers/PaymentController.cs index 6dc9c8b..280e8e4 100644 --- a/src/BCards.Web/Controllers/PaymentController.cs +++ b/src/BCards.Web/Controllers/PaymentController.cs @@ -6,6 +6,7 @@ using BCards.Web.Utils; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; +using System.Globalization; namespace BCards.Web.Controllers; @@ -237,7 +238,7 @@ public class PaymentController : Controller { PlanType = planKey.ToLower(), DisplayName = planSection["Name"] ?? planKey, - Price = decimal.Parse(planSection["Price"] ?? "0"), + Price = decimal.Parse(planSection["Price"] ?? "0", new CultureInfo("en-US")), PriceId = planSection["PriceId"] ?? "", MaxLinks = int.Parse(planSection["MaxLinks"] ?? "0"), AllowAnalytics = bool.Parse(planSection["AllowAnalytics"] ?? "false"), diff --git a/src/BCards.Web/Views/Payment/ManageSubscription.cshtml b/src/BCards.Web/Views/Payment/ManageSubscription.cshtml index 2aa87b8..f3f191d 100644 --- a/src/BCards.Web/Views/Payment/ManageSubscription.cshtml +++ b/src/BCards.Web/Views/Payment/ManageSubscription.cshtml @@ -1,3 +1,4 @@ +@using System.Globalization @model BCards.Web.ViewModels.ManageSubscriptionViewModel @{ ViewData["Title"] = "Gerenciar Assinatura"; @@ -161,7 +162,7 @@
@plan.DisplayName
-

R$ @plan.Price.ToString("F2")

+

R$ @plan.Price.ToString("F2", new CultureInfo("pt-BR"))

    @foreach (var feature in plan.Features) {