Hi,
I tried to use the
String.Format("{0:0.####}", double_number);
method in my c# application but I have a problem.
I have an application developed with Visual Studio 2008, using c#. It
has to communicate with an activeX shockwave flash object, sending a
double variable. Since the only way to make c# and flash communicate
is the SetVariable method, which supports only the string type, I have
to pass my double variable from c# to flash, converting it to a string
e then reconverting it to the Number type in flash.
The double ToString() method doesn't work properly, i.e. it gives me a
string with the floating point
indicated with a ",", while flash requires a decimal number with the
dot. But the String.Format method gives me the same result, even if I
set the "." in the regular expression.
I try to explain it better with an example:
string s = String.Format("{0:0.####}", 30.54);
MessageBox.Show(s);
it shows me the string "30,54" in the message box and not the "30.54"
one. So when I pass it to flash, it doesn't recognize the number, and
cannot convert it properly.
I'm using the italian version of VS2008, so maybe that is due to an
internal italian representation of decimal numbers?
Can anyone give me any help?
Thank you in advance.
Greetings.
Simon.u