Update number on the screen without updating strings

I am making a game where the player can click on a unit and its stats will be shown on screen (like Warcraft 3). However, I know that updating strings is not the best way to do this. So what should I do?

Should I fix all the stat in different panels and only show them when the right unit is clicked on?
Is there an optimal way for this case ? Thanks in advance for your answer!

Updating strings is fine, but just like everything, you want to avoid doing it continuously if you can avoid it. Generally for something like this you want to set the string at the start, then only update it when/ the stats change. Then you can show and hide the string when you need to without updating the text.