Store an int in key local variable

Hi, I got this question, I want to store the asa id so and integer as a key. What’s the best way to do it?

Just use itob: Opcodes - Algorand Developer Portal

Note that it will convert the integer into a big-endian byte string, not into its decimal representation.
This is much more compact but will not be displayed nicely in most places like block explorers (which should not be a real issue).

Converting to a decimal or hexadecimal string is possible but require to write your own code. Furthermore it takes more space. So it is really not recommended.