Skip to content
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

Weird values for floats in mod menu #541

Closed
qqqbbb opened this issue Apr 4, 2024 · 1 comment
Closed

Weird values for floats in mod menu #541

qqqbbb opened this issue Apr 4, 2024 · 1 comment
Assignees

Comments

@qqqbbb
Copy link

qqqbbb commented Apr 4, 2024

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 JKohlman removed the Type: Bug label Apr 4, 2024
@JKohlman JKohlman self-assigned this Apr 4, 2024
@JKohlman
Copy link
Contributor

JKohlman commented Apr 4, 2024

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.#}.

@JKohlman JKohlman closed this as completed Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants