I'm building a CGPA calculator in Figma using variables, but it’s giving strange results—any idea why?
Hey everyone! 👋
So I’m working on a simple CGPA calculator prototype using Figma variables (just for demo purposes, not full logic), and I’ve run into an odd issue. I've set up number keys from 1 to 9, and I'm using a variable called #Result
to store and display the user's CGPA or input.
Here's the interaction logic I’m using:
Every time a number key (say 7) is clicked, I update the variable like this:Result = Result * 10 + 7
So, ideally, the input flow should look like: 0 → 7 → 77 → 777 → 7777 → …
But what’s happening instead:
After a few clicks, it suddenly turns into: 77777776 → 777777792 → -2147483648 😩
…and then it stops responding.