Which is faster, int to String or String to int?
<p>This may seem like a fairly basic question, for which I apologise in advance.</p>

<p>I'm writing an Android app that uses a set of predefined numbers. At the moment I'm working with <code>int</code> values, but at some point I will probably need to use <code>float</code> and <code>double</code> values, too.</p>

<p>The numbers are used for two things. First, I need to display them to the user, for which I need a <code>String</code> (I'm creating a custom <code>View</code> and drawing the <code>String</code> on a <code>Canvas</code>). Second, I need will be using them in a sort of calculator, for which they obviously need to be <code>int</code> (or <code>float</code>/<code>double</code>).</p>

<p>Since the numbers are the same whether they are used as <code>String</code> or <code>int</code>, I only want to store them once (this will also reduce errors if I need to change any of them; I'll only need to change them in the one place).</p>

<p>My question is: should I store them as <code>String</code> or as <code>int</code>? Is it faster to write an <code>int</code> as a <code>String</code>, or to parse an <code>int</code> from a <code>String</code>? My gut tells me that parsing would take more time/resources, so I should store them as <code>int</code>s. Am I right?</p>
