You might find it easiest to write your own class that has fields for both the string that the user entered and the int or double value it represents.

It depends somewhat on what exactly you are...