View Single Post
  #2 (permalink)  
Old December 16th, 2011, 10:31 AM
Rod Stephens's Avatar
Rod Stephens Rod Stephens is offline
Wrox Author
Points: 3,166, Level: 23
Points: 3,166, Level: 23 Points: 3,166, Level: 23 Points: 3,166, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jan 2006
Location: , , .
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts

Lesson 34 has more to say about internationalization. I wrote all of the examples on my computer set up for United States English so things like monetary values use that format. So, as you noticed, they probably won't work properly in other countries. Sorry about the confusion.

You found the right solution: change the values to use your local formats. There are ways you can make things like int.Parse read formats from countries other than the one you're in but that would just confuse matters and not be all that helpful.

Note that values inside your code should always be in the United States formats. Not because those are better but to be consistent Microsoft had to pick something and, since they developed C# in the United States, that's the format they decided to use. Hopefully the difference won't be too annoying.

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)