how to use decimal format to compare values?
<p>Im getting two percent values-above percent and below percent as input from user and have to compare with  percent value which may be +12.05% or -12.05% and stored in database..I used decimal format and received error..</p>

<pre><code>DecimalFormat newpercent= DecimalFormat.getPercentInstance(percent);
</code></pre>

<p>i receive error in getPercentInstance()..</p>

<p>whether the datatype im used is right?have to use any other datatype other than decimal format?</p>

<p>percent is string value in database..EX:</p>

<pre><code>newpercent=percent
maxpercent=abovepercent
minpercent=belowpercent
</code></pre>

<p>further i will compare newpercent with maxpercent and minpercent in my code..</p>
