zechyc / Tilted-Bed-Conveyor

Tilted bed conveyor belt for 3D printer
17 stars 7 forks source link

Parsing ,. #1

Open bartokon opened 3 years ago

bartokon commented 3 years ago

Hey, Could you add to double.Parse commands CultureInfo?: double.Parse(temp[segment].Substring(1)); to: double.Parse(temp[segment].Substring(1), CultureInfo.InvariantCulture); and also .ToString();?

wjsteele commented 3 years ago

Hmmm... can you describe why you need this? GCode doesn't use international conventions, so parsing a GCode segment using a command like that isn't actually going to produce valid output. Marlin uses the traditional GCode format, which only supports "." as a decimal separator, for example, and using a specific country/region will break that. Perhaps, however, the code can be converted to an InvariantCulture instead if you're seeing a problem.

Feel free to edit the file and make a pull request.

wjsteele commented 3 years ago

Ah... you seem to have edited your comment. Good... that will work.

But, still, you can easily edit it and make the pull request.

bartokon commented 3 years ago

Why do I need this? I live in EU/Poland and my C# interpreter crashes because of this :) (even with ready .exe you provided). Hmm, I could try to create pull request, but I even can't test it properly if reference doesn't work, bah I don't even have a belt printer Yet :D I will try to update this code if I find some more time. I hope that somebody with the same issue will find this workaround useful :)