SubnauticaModding / Nautilus

Nautilus, the Subnautica Modding API (formerly SMLHelper)
https://subnauticamodding.github.io/Nautilus/
GNU General Public License v3.0
69 stars 37 forks source link

Weird values for floats in mod menu #541

Closed qqqbbb closed 6 months ago

qqqbbb commented 6 months ago

Screenshot

Code to reproduce the behavior:

    public class Config : ConfigFile
    {
        [Slider("My multiplier", .1f, 2f, DefaultValue = 1f, Step = .1f, Format = "{0:R0}", Tooltip = "")]
        public float mult = 1f;
    }

In the mod menu set the value to 1.3

Nautilus v1.0.0-pre.29

JKohlman commented 6 months ago

Not an issue. This is simply floating point precision errors.

Don't use {0:R0} if you don't want to display like this, use {0:0.#}.