Skip to main content

Add limits to numeric variables value

  • September 12, 2024
  • 4 replies
  • 264 views

Marie_Rang

Hi!

I would like it to be possible to set limits to numerical value variables, such as a max and min number (like when I use it to make shopping carts I would easily like to be able to just set it up in a way that the value for variable “in_cart” cannot go below 0.

Additionally it would be nice if you could define the limits to round off on variables, such as round to max 2 decimals or even to be able to set an integer variable, meaning that it needs to round the variable calculation always up to an integer.

The second idea is not that common of a use case, but I think the first one is definitely.

4 replies

Bauke_Schildt
  • Active Member
  • 60 replies
  • September 12, 2024

+1 to be able to define a numerical value to not go negative so I don’t have to have a “if value == 0” everywhere.

Figma already does rounding, but it’s always 2 decimals.
0.115 rounds to 0.11, 0.116 rounds to 0.12

As for min and max number, I think that’s something I’d prefer defining per item. I think it might be a bit hard to figure out bugs if you’re not expecting it.


Marie_Rang
  • Author
  • 9 replies
  • September 12, 2024

Oh true you’re right about the 2 decimal point thing, I just used it as an example. My idea was more that you could set a numerical variable to be integers only, i.e. it rounds up to a full number.


djv
Figmate
  • Community Support
  • 4773 replies
  • September 16, 2024

Hey @Marie_Rang, thanks for the feedback!

We’ll pass this onto our team for future consideration.


Rob_Dozier


Thought y’all would get a kick out of this, ran into the decimal problem earlier. Happy holidays!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings