Skip to content

Commit

Permalink
Merge pull request #335 from LiamMorrow/fix-decimal-separator
Browse files Browse the repository at this point in the history
Fix decimal separator
  • Loading branch information
LiamMorrow authored Dec 3, 2024
2 parents 08ddb20 + 4dbfe81 commit 5dac227
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
15 changes: 13 additions & 2 deletions LiftLog.Maui/Platforms/iOS/AppDelegate.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Foundation;
using System.Globalization;
using Foundation;
using LiftLog.Maui.Services;
using UIKit;

Expand All @@ -7,5 +8,15 @@ namespace LiftLog.Maui;
[Register("AppDelegate")]
public class AppDelegate : MauiUIApplicationDelegate
{
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
protected override MauiApp CreateMauiApp()
{
var app = MauiProgram.CreateMauiApp();
var newCulture = CultureInfo.CurrentCulture.Clone() as CultureInfo;
newCulture!.NumberFormat.NumberDecimalSeparator = NSLocale.CurrentLocale.DecimalSeparator;
newCulture.NumberFormat.CurrencyGroupSeparator = NSLocale.CurrentLocale.GroupingSeparator;

CultureInfo.CurrentCulture = newCulture;
CultureInfo.CurrentUICulture = newCulture;
return app;
}
}
3 changes: 1 addition & 2 deletions LiftLog.Maui/Platforms/iOS/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using ObjCRuntime;
using UIKit;
using UIKit;

namespace LiftLog.Maui;

Expand Down

0 comments on commit 5dac227

Please sign in to comment.