Dim Latitude as Single = 3.5
Dim Culture As Globalization.CultureInfo = New Globalization.CultureInfo("en-US")
LabelLatitude.Text = Latitude.ToString(Culture)
Automatic translators can not translate ToString(Culture) in this code
Since you are using a Numeric value, you will want to use the NumberFormat propery from your Culture object :
//Your variable (renamed to avoid conflicting with your Textbox name)
Single YourLatitudeValue = 3.5;
//Declaration of your culture
System.Globalization.CultureInfo Culture = new System.Globalization.CultureInfo("en-US");
//Formatting the textbox based on your culture
Latitude.Text = YourLatitudeValue.ToString(Culture.NumberFormat);
www.cmsaspne...
Member
34 Points
34 Posts
Help convert VB to C#
Feb 01, 2013 04:22 PM|LINK
Dim Latitude as Single = 3.5 Dim Culture As Globalization.CultureInfo = New Globalization.CultureInfo("en-US") LabelLatitude.Text = Latitude.ToString(Culture)Automatic translators can not translate ToString(Culture) in this code
https://sourceforge.net/projects/cmsaspnet/
Amazing "CMS+FORUM+GALLERY+WIKI+COMMUNITY vb.NET" easy user-friendly
Rion William...
All-Star
27276 Points
4515 Posts
Re: Help convert VB to C#
Feb 01, 2013 04:55 PM|LINK
Since you are using a Numeric value, you will want to use the NumberFormat propery from your Culture object :
//Your variable (renamed to avoid conflicting with your Textbox name) Single YourLatitudeValue = 3.5; //Declaration of your culture System.Globalization.CultureInfo Culture = new System.Globalization.CultureInfo("en-US"); //Formatting the textbox based on your culture Latitude.Text = YourLatitudeValue.ToString(Culture.NumberFormat);