I have a Label that displays the sum of amounts as Currency:
List<decimal> dataAmounts = App.DashboardModel.Amounts.Where(o => Convert.ToDecimal(o.Amount) >= 0).Select(o => Convert.ToDecimal(o.Amount)).ToList();
lblPagoMinimo.Text = dataAmounts.Sum().ToString("C");
Where Amount is retrieved as a string (throught api call) and converted to decimal.
It displays text like it's expected in my Android phone and two phones more (We are all in the same country). Example: $123.45. But there's a complaint of someone getting the Total like this $12.345
I was thinking this is something related to Culture but it doesn't makes sense how the decimal point in the wrong place. The only thing I know is that this error is showing in an iPhone X.
Is there a reason for this to happen? is it related to Locale Culture or...?
Make sure you are using CultureInfo
when converting double ToString.
https://learn.microsoft.com/en-us/dotnet/api/system.double.tostring?view=netcore-3.1