-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Fix: Strip integer part in "decimals" #22251
Conversation
Nice! One thing I'd like to mention is that the precision goes up to maxn-1, as I'm sure you know. To increase the decimal points it checks against, both maxn as well as the doubles within the sd-array have to be increased (i.e. 1.000000005 currently returns 0, but by increasing them by one, returns 9). |
29ded92
to
a3323c8
Compare
@DeuxAlpha Note that when grabbing the value from a single-precision float around 1, it cuts off at 7 (or less, if the number is large). But yes, I've changed that to go up to 9 like it did before. |
a3323c8
to
3188eb2
Compare
Note: Core only.
3188eb2
to
5f4f9ca
Compare
Why not include the same fix in |
@akien-mga The current C# "Decimals" behaves as a decimal counter ("1.2345" returns 4) so I think whoever implemented that must've been confused of what the C++ implementation was. The GDscript and C++ behavior is not present in C# yet. I can't fix code which doesn't exist. This is why I added it to my other PR instead of making a new one, but I made one here since you requested it. If I changed the C# code in this PR, then it would be basically the same as the other PR except for lacking the adding of the "step_decimals" GDscript alias. May as well merge the other one. |
Thanks, looks good. |
CC @akien-mga Fixes #22216 See also #21425 Suggested milestone: 3.1.