The string representation of the double is written to and read from the file using the C # application.
A C # application converts double to string using the following snippet:
value.ToString("R", NumberFormatInfo.InvariantInfo);
C # application converts a string to double using the following snippet
double num = double.Parse(s, NumberStyles.Float, (IFormatProvider) NumberFormatInfo.InvariantInfo);
If the same file were to be written and read using a Java application, how could you convert types without losing data?
source share