I'm having a little trouble with the output of my label, what ever format code I use it displays with a decimal point instead of comma
For instance I would like to output like the following: 1,234 but my code replaces the comma with a decimal point?
Below is my code:
label1,text = double,parse(label1,text),tostring("N0");
Please ignore my commas above, the editor wouldn't let me insert a dot :-)
VulpesPosted Jun 26, 2014, 2:07 PM
So, if I mimic this culture:
I get "1.234" instead of "1,234".
To see whether there's any mileage in this idea, you could try running the above code with en-US replacing it-IT.
mike DelvottiPosted Jun 26, 2014, 3:06 PM
mike DelvottiPosted Jun 26, 2014, 1:43 PM
Culture?
Maybe that's where the issue could be, as my form is just set to default language in VS.
Do I need to set the culture in my code somewhere?
Even if I use the "C" format it appears like so: £1.234 instead of the expected £1,234
VulpesPosted Jun 26, 2014, 1:26 PM
label1.Text = double.Parse(label1.Text).ToString("N0");
changes it, as expected, to "1,234".
Which culture are you using here?