I wanted to have a converter in C# to convert inputs like 123.456 to numbers like 0.123456 and also 0.123456 back to 123.456
The problem is when I use double.TryParse(...) to parse the input, I often ran into a floating point problem, that the numbers get rounded to 123.999999 instead of 124 for instance (just an example to show what I mean).
This can happen depending on the number that I have in the string.
How can I deal with that and convert these values correctly?