Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use culture independent ToString for converting doubles to string #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vvoland
Copy link

@vvoland vvoland commented May 24, 2017

Fix issue #2

@@ -423,7 +424,11 @@ public static void WriteData(double[] x, double[] y, double[] z, StreamWriter st
{
if (i > 0 && x[i] != x[i - 1])
stream.WriteLine("");
stream.WriteLine(x[i] + " " + y[i] + " " + z[i]);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

string.Format accepts CultureInfo, no need to call ToString for every parameter
string.Format(CultureInfo.InvariantCulture, "{0} {1} {2}", x[i], y[i], z[i]);

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's nifty! Didn't like that line at all but didn't think about any other way to do it. Thanks! Fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants