aggieben / xmlrpcnet

Automatically exported from code.google.com/p/xmlrpcnet
0 stars 0 forks source link

Seralizing of double values with highest possible precesion #107

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Define a method which has a double value
2. Call the method with a double value which have a high precision (e.g. 
Double.MaxValue)

What is the expected output? What do you see instead?
The value on the client is not identical on server and client.

What version of the product are you using? On what operating system?
3.0.0.270

Please provide any additional information below.
This could be fixed in the XmlRpcSerializer class in the Serialize() method 
(Line: 172).
The current code is:
WriteFullElementString(xtw, "double", doubleVal.ToString(null, 
CultureInfo.InvariantCulture));

This should be replaced by:
WriteFullElementString(xtw, "double", doubleVal.ToString("G17", 
CultureInfo.InvariantCulture));

See also:
http://msdn.microsoft.com/en-us/library/d8ztz0sa.aspx (Chapter: Remarks)

Original issue reported on code.google.com by licht...@gmail.com on 10 Apr 2013 at 3:15