Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Decimal separator bug

$
0
0

Hi everybody,

Im working on cross-platform app and i have problem with decimal separator - Im from Czech Republic, my phone use CultureInfo("cs-CZ") and it expects decimal comma instead of decimal dot.

Im building app layout and in XAML and I have problem with these lines of code:

RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.25}"

RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.6}">

When I start this app in "English environment" - it works, but I want it to run on my smartphone with Czech localization and here is what happen:

A System.FormatException was thrown.
Unknown char

at double.Parse (string,System.Globalization.NumberStyles,System.IFormatProvider)
at double.Parse (string)
at Xamarin.Forms.Xaml.TypeConversionExtensions.ConvertTo (object,System.Type,System.Func`1<System.Reflection.MemberInfo>)
at Xamarin.Forms.Xaml.MarkupExtensionParser.SetPropertyValue (string,string,object)
at Xamarin.Forms.Xaml.MarkupExpressionParser.HandleProperty (string,System.IServiceProvider,string&)
at Xamarin.Forms.Xaml.MarkupExtensionParser.Parse (string,string&,System.IServiceProvider)
at Xamarin.Forms.Xaml.MarkupExpressionParser.ParseExpression (string&,System.IServiceProvider)
at Xamarin.Forms.Xaml.MarkupNode.ApplyTo (object,Xamarin.Forms.Xaml.XmlName,Xamarin.Forms.INameScope)
at Xamarin.Forms.Xaml.INodeExtension.ApplyProperties (Xamarin.Forms.Xaml.IElementNode,object,Xamarin.Forms.INameScope)
at Xamarin.Forms.Xaml.ElementNode.ApplyProperties (Xamarin.Forms.INameScope)
at Xamarin.Forms.Xaml.ElementNode.Create (Xamarin.Forms.IElement,Xamarin.Forms.INameScope)
at Xamarin.Forms.Xaml.ListNode.ApplyTo (object,Xamarin.Forms.Xaml.XmlName,Xamarin.Forms.INameScope)
at Xamarin.Forms.Xaml.INodeExtension.ApplyProperties (Xamarin.Forms.Xaml.IElementNode,object,Xamarin.Forms.INameScope)
at Xamarin.Forms.Xaml.ElementNode.ApplyProperties (Xamarin.Forms.INameScope)
at Xamarin.Forms.Xaml.ElementNode.Create (Xamarin.Forms.IElement,Xamarin.Forms.INameScope)
at Xamarin.Forms.Xaml.ElementNode.ApplyTo (object,Xamarin.Forms.Xaml.XmlName,Xamarin.Forms.INameScope)
at Xamarin.Forms.Xaml.INodeExtension.ApplyProperties (Xamarin.Forms.Xaml.IElementNode,object,Xamarin.Forms.INameScope)
at Xamarin.Forms.Xaml.RootNode.ApplyProperties (Xamarin.Forms.INameScope)
at Xamarin.Forms.Xaml.XamlLoader.Load (Xamarin.Forms.VisualElement,string)
at Xamarin.Forms.Xaml.XamlLoader.Load (Xamarin.Forms.VisualElement,System.Type)
at Xamarin.Forms.Xaml.Extensions.LoadFromXaml<Novatop.MainPage> (Novatop.MainPage,System.Type) <0x0004f>
at Novatop.MainPage.InitializeComponent () [0x0000c] in /Users/martinbarton/pria/novatop/Android/obj/Debug/MainPage.xaml.g.cs:20
at Novatop.MainPage..ctor () [0x00008] in /Users/martinbarton/pria/novatop/MainPage.xaml.cs:12
at Novatop.App.GetMainPage () [0x00001] in /Users/martinbarton/pria/novatop/App.cs:18
at Novatop.Android.MainActivity.OnCreate (Android.OS.Bundle) [0x00010] in /Users/martinbarton/pria/novatop/Android/MainActivity.cs:24
at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (intptr,intptr,intptr) [0x00011] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/41933531/source/monodroid/src/Mono.Android/platforms/android-14/src/generated/Android.App.Activity.cs:1943
at (wrapper dynamic-method) object.03cca4c3-9457-462c-b80d-b453669debbb (intptr,intptr,intptr)

Exception is thrown on > this.LoadFromXaml(typeof(MainPage));> and app dont even start.

Replacing decimal dots with commas dont work and I dont really know what to do now..

Please help me :)


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>