[Percentage] attribute?

Issue #496 new
V created an issue

I often find myself having percentages in settings menus. Those are often 0f-1f to translate to 0% and 100% in floating point logic.

I tried once to make a conversion myself to allow another user to input 100% to then translate it to 1f in code to actually use it in math every time i needed it. But it quickly became combersome.

Is there a way to add an attribute like [Percentage] on a float/double That basically allows the user to input percentages like normal, but they are stored in that float normally as if the user input the 0.1f 0.5f 1f 1.5f equivalent? Maybe it should also automatically add that [SuffixLabel("%")] for the occasion?

This makes it easier to work with percentages in game settings if it works like that. But would need proper documentation to not be confusing to programmers.

Comments (0)

  1. Log in to comment