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

Medusa float #90

Closed
Misiur opened this issue Mar 26, 2016 · 6 comments
Closed

Medusa float #90

Misiur opened this issue Mar 26, 2016 · 6 comments
Assignees
Labels

Comments

@Misiur
Copy link

Misiur commented Mar 26, 2016

new dbhandle;
EstablishConnection(dbhandle);

new string[128];
new Float:medusa = -9.170000;
printf("%f", medusa);
mysql_format(dbhandle, string, sizeof string, "%.2f", medusa);
print(string);
format(string, sizeof string, "%.2f", medusa);
print(string);
[19:05:38] -9.170000
[19:05:38] -9..70
[19:05:38] -9.17

I caught that in the wild causing me query errors. Usually %.2f works fine, just this error caught my eye

@Misiur
Copy link
Author

Misiur commented Mar 26, 2016

If that changes anything, I'm running MariaDB

@Misiur
Copy link
Author

Misiur commented Mar 26, 2016

*output_str = '.';
this is only instance adding dots that I can see

@Misiur
Copy link
Author

Misiur commented Mar 26, 2016

After a little bit of investigation I discovered that it happens for number such as -9, -99, -999, etc. with fraction part other than 0, so -9.01, etc.

@maddinat0r
Copy link
Collaborator

Are you using R39 or R40?

@Misiur
Copy link
Author

Misiur commented Mar 27, 2016

R39-4

@maddinat0r
Copy link
Collaborator

Yep, that's definitely a bug.

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

No branches or pull requests

2 participants