about:config should always display the default values of floating-point values with a decimal part, to distinguish visually from integers
Categories
(Core :: Preferences: Backend, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox71 | --- | fixed |
People
(Reporter: jfkthame, Assigned: jfkthame)
Details
Attachments
(1 file)
When a pref that has a floating-point type is displayed in about:config, it would be helpful to ensure that a trailing decimal is always included (i.e. append ".0" if the value happens to be an integer), to distinguish from values of integer type.
For example, until recently the default value of layout.css.devPixelsPerPx
was defined in libpref/init/all.js as pref("layout.css.devPixelsPerPx", "-1.0");
, deliberately including a decimal so that when viewing in about:config, it's clear that fractional values are accepted. But since it was converted to StaticPrefs in bug 1573992, with a type of AtomicFloat
and default value -1.0f
, it appears in about:config as a bare "-1", which is easily misinterpreted as suggesting it is an integer preference.
(It was always the case that a floating-point pref could end up displayed with no decimal, if it was explicitly given such a value; but with the move from defining the default as a string in all.js to a float in StaticPrefList.yaml, we no longer have the ability to ensure the initial value shows a decimal, so this has become a more significant issue.)
Assignee | ||
Comment 1•5 years ago
|
||
Actually, it looks like about:config only knows about boolean, integer (which it - misleadingly - refers to as Number), and string prefs, so perhaps this is really a request for StaticPrefs to store floating-point values as strings that always include a decimal.
Assignee | ||
Comment 2•5 years ago
|
||
AFAICS, prior to bug 1493955 such values would normally have displayed with decimals (via printf-like formatting), but the change to using nsTSubstring::AppendFloat, which uses FormatWithoutTrailingZeros, means that trailing zeroes are now stripped.
I think for clarity we should restore a trailing ".0" to the string form when the floating-point pref has an integer value.
Assignee | ||
Comment 3•5 years ago
|
||
Comment 5•5 years ago
|
||
bugherder |
Updated•5 years ago
|
Description
•