Cerebrus
unread,Jun 2, 2009, 12:45:01 PM6/2/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
You are correct in your suspicion that the comma as a decimal
separator is due to the regional settings configured upon your version
of Windows. (Regional settings).
The String.Format method never ceases to amaze me with it's power, in
this case, by virtue of being culture sensitive. IOW, It formats
values according to your culture. In your case, the problem arises not
because .NET is creating the decimal separator as a comma, but because
your version of Flash is not complying with your system settings. (I
don't develop shockwave... I have no idea if it even has this feature)
However, since you wish to override this default behaviour of the
String.Format method, you can use the overload that specifies an
IFormatProvider:
---
string s = String.Format(NumberFormatInfo.InvariantInfo, "{0:0.####}",
30.54);
---
Setting it to the Invariant culture format ensures that values will be
formatted according to en-US (the programmers' universal
culture! ;-)).