-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Floating point values entered in inspector rounded to 3 decimal places #75150
Comments
As far as I can tell, the tooltip is always showing the actual value (if
you enter 0.1, the tooltip shows "0.10000000000582" as expected). So the
actual stored value is truncated. It seems to me that if you enter
1.414213562:
1. 1.414213562 is truncated (as a string?) to 1.414.
2. 1.414 is set as the float value.
3. 1.414 of course cannot be stored as the exact value of a float, so is
stored as the closest float value 1.41400000000431.
…On Mon, Mar 20, 2023 at 10:57 AM A Thousand Ships ***@***.***> wrote:
Is the actual value truncated or just the display?
—
Reply to this email directly, view it on GitHub
<#75150 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQPYMQZZEN65SVVOODAGNJLW5CK7TANCNFSM6AAAAAAWBNG3EU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Which property did you try entering the value in? Check its property hint in the source code to see the rounding step it applies (
Please comment in the original issue instead of creating a new issue in this case. |
I am trying to edit a transform position. So the float is part of a vector3. Changing Default Float Step in editor settings has no effect, so there must be a valid property hint. godotengine/godot-proposals#3524 looks exactly right and covers the use case for my issue. Thanks for linking that, I hadn't found it before - it's clear that this is part of a larger discussion and not a simple fix. Feel free to close this ticket in favor of others with more context. |
Default Float Step only affects float properties, not vector/transform properties. |
Godot version
v4.0.stable.official [92bee43]
System information
Linux Mint
Issue description
Entering a float value in the editor forcibly rounds the input to 3 decimal places. I see issue #18251 was opened in 2018 on v3.0.2, and pull #25470 which was closed in favor of pull #30776 which has a related commit (it looks to me like this fix was for the slider functionality), but the issue remains.
When I mouse over a float value in the editor the tool tip shows the full precision. If I try to enter a value in the editor, it is truncated to 3 decimals. The editor allows you to enter a float of any length.
For example, if you enter an approximation of
sqrt(2)
into a transform position:"1.414213562"
the editor will save the value (and display it back to you in the tool tip) as 1.41400000000431. This is the closest float32 approximation of 1.414, not the closest float32 approximation of 1.414213562.This is an issue for float32s as part of vectors, but also stand-alone float64s.
Steps to reproduce
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered: