Numbers display as rounded to nearest 0.001

This is about all numbers in Properties tab: number values, number attributes

I have a drop chance system that is essentially based on this:
image
This method allows me to easily change things without having separate modules for drop lists, or whatever like that. But very rarely, I want something to be really rare, like 0.0005. Around that number the problem starts. When I type it, it changes to nearest thousandth part:
image image
However, it still actually is 0.0005, despite showing 0.001. I can print the actual value:
image

If I reselect that value, it will still show 0.001, and when I deselect it, it actually becomes 0.001, and I essentially lose whatever I typed in before.
Even worse thing happens for values lower than 0.0005, they appear as 0:
image image
But they still are actually that value:
image

This is very bad, catastrophic even, for small fractions in which I can’t see the significant figures.

All beta features and system information seem irrelevant, but:
UIDragDetectors, Dragger QOL, Improved Find All, Improved UIStrokes, Next Gen studio preview
Happens both with and without Next Gen studio enabled.
System: Intel(R) Core™ i5-7300HQ CPU @ 2.50GHz, 24GB, SSDPR-CL100-480-G3, Intel(R) HD Graphics 630, NVIDIA GeForce GTX 1050

Expected behavior

I expected the actual value of a property to appear, especially when it’s a fraction and the hidden digits are very significant.
I could even say there’s no need to round it at all, because the studio is for developers and we should see correct numbers and not nicely rounded ones.

Please, it seems like it’s easy and quick to fix and would really save me a lot of time.

I would imagine the rounding is to account for floating point imprecision, so I can’t imagine they would change it.

The value being set to the incorrect number when clicking it is pretty ridiculous though and should be changed. (although the same imprecision would probably apply)

Floating point numbers have a limited number of digits they can represent, they cannot represent all real numbers, not a roblox bug or studio bug.

That could be the reason, but the imprecision is far smaller than 0.001 (it starts like, 16 digits after the decimal point?), so 0.0003 should show as it is, or even without any rounding as 0.00030000000000000003, and not as just 0 (that is actual result of 0.0001+0.0002).

True that they can’t represent all real numbers, but that doesn’t matter for this report.
What I’m saying is that when you save 0.00005 in NumberValue, it is internally saved correctly as 0.00005, but the properties window displays it as 0.

Dont believe that matters because once you publish, save, or re-open studio, the studio will fix it and put it back to 0, because what is on the display is what will be true, not whatever your machine has saved.

For example, if you put 0.00005 through tonumber(), im 99.9% sure it will return 0.

Still not a bug :stuck_out_tongue:

I checked, after restarting studio the number appears as 0.001, but in console print(part:GetAttribute("chance")) still returns 0.0005. It’s the property display which is incorrect.

While trying to verify the 2nd paragraph, I discovered that Roblox should allow me to write extremely small numbers like 10^(-300) (One over googol over googol over googol), as long as there are no significant figures earlier than that:

print(tonumber("0.00005")) --> 0.00005
print(tonumber(0.00005)) --> 0.00005
--in fact, even:
print(tonumber(0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005))
--> 5e-160, (still a valid number, just displayed like that)
print(10^(-300)) --> 1e-300 (still a valid number)
print(10^(-350)) --> 0 (that's where it hits 0)

And those extremely small numbers work as attribute values (can be set and read by a script, but not from property window), so that rules out floating point imprecision. It’s just unnecessarily being rounded in the Properties window.

Scientific notations are still “rounded” numbers for computers, not sure why you brought it up here. But I suppose thats interesting

just store it as a string attribute then use tonumber() – it probably has something to do with how roblox displays numbers in the properties window.

I think it showing a rounded value is intentional (try printing out the Orientation of a Part after rotating it on a few different axes and mixing in local and world-space and you’ll see why it’s needed), but the value being lost when you actually click it seems like a mistake.

image

While this isn’t a bug, it is actually an interesting problem. The comments above saying it’s displayed this way because of floating point imprecisions are correct: We wouldn’t want to display the entire value because it would take up a lot of space and make for a bad experience while editing previously inputted values. We also don’t store any metadata on properties, as they’re meant to be lightweight single values, so we can’t store how many places you entered the number up to.

However, we’re working on a big QOL update for the properties panel right now, and I think I know of a solution. How would you feel if the properties panel always displayed 3 significant digits after the decimal point, culling trailing zeros?

For example: inputing 25.0056789 would be truncated to 25.00568 while still retaining its underlying value, but entering 1.0100 would be displayed as 1.01. As a precaution, we’d still need to have values close to whole numbers be rounded to their whole number parts, eg: 1.00000000000000002 becomes 1, 3.999999999999996 becomes 4. We’d also probably still keep the old behavior of 3 digits after the decimal point for combined number values (UDim2, Vector3, etc) as to not clutter the display.

I’d like this, but I think I’d also like it if the actual full value stored could be seen by hovering over the property for a while. So, entering 25.0056789 would show 25.0056781768798828125 in a popup hint.

Idk it’s been like that since the dawn of time so, I didn’t really think about it really, I don’t consider it a bug personally because I can’t see why a bug would trigger a clamping of values, it’s like when you enter large values, there’s a scientific notation because numbers aren’t in pure binary format, they use approximations to translate those big numbers and then the view has to render them properly.
I guess that’s how they want it to look like? Again that’s surely a feature that may be discussed, I don’t see the point of adding/not adding it, I don’t really mind about it and don’t find it specifically annoying either :person_shrugging:

EDIT : Just got staff answers, I like the provided suggestion