-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
double.ToString() and float.ToString() not working as described #406
double.ToString() and float.ToString() not working as described #406
Comments
float.ToString() and double.ToString() exhibiting odd behavior and extra zero (0) padding applied. See attached example: Program.zip Here is the output that I get using various format specifiers: Float - format specifier: 'N' of '1234.0123456789' is 1,234.0100 Double - format specifier: 'N' of '1234.0123456789' is 1,234.0100 Float - format specifier: 'F' of '1234.0123456789' is 1234.0100 Double - format specifier: 'F' of '1234.0123456789' is 1234.0100 Float - format specifier: 'G' of '1234.0123456789' is 1234.012329101000000000 Double - format specifier: 'G' of '1234.0123456789' is 1234.012345678899919000000000000000 |
@MatthiasJentsch could you please look into this? Could it be a regression or something that hasn't being tested before? |
Sorry. I've tested only these cases:
I'll test the described behavior and will try to find a fix for this. |
Details about Problem
nanoFramework area: nanoCLR preview 791 / nanoFramework.CoreLibrary preview 62
Worked before? No
Detailed repro steps so we can see the same problem
(47.0).ToString()
returns "47.000000000000000" and(11.0f).ToString()
returns "11.000000000". But in lib-CoreLibrary\source\System\Number.cs for format "G" is stated: "Trailing zeros after the decimal point are removed, and the resulting string contains a decimal point only if required."The text was updated successfully, but these errors were encountered: