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

String.num now prints trailing zeroes on whole numbers #10743

Open
123outerme opened this issue Mar 4, 2025 · 2 comments
Open

String.num now prints trailing zeroes on whole numbers #10743

123outerme opened this issue Mar 4, 2025 · 2 comments
Labels
area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository

Comments

@123outerme
Copy link

Your Godot version:
4.4-stable

Issue description:
In Godot 4.4, Calling String.num with an integer/whole number parameter with no second argument returns a String for that number with a trailing ".0". For example, String.num(42) returns "42.0". The docs for String.num say that trailing zeroes are not printed.
In 4.3, this was correct, and String.num(42) returned "42".

URL to the documentation page:
https://docs.godotengine.org/en/4.4/classes/class_string.html#class-string-method-num

@AThousandShips
Copy link
Member

This might be a case of confusion, I think the "trailing zeroes" referred to here are for String.num(3.14159300) where no zeros are printed, but should be clarified

@AThousandShips AThousandShips added the area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository label Mar 4, 2025
@hua-zhi-wan
Copy link

This might be a case of confusion, I think the "trailing zeroes" referred to here are for String.num(3.14159300) where no zeros are printed, but should be clarified

But in version 4.3, the behavior of this method does not include the last 0, and some projects (including mine) do rely on this feature. This change has actually caused even greater confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository
Projects
None yet
Development

No branches or pull requests

3 participants