title: Return double type without trialing zero
body: <p>I am trying to return the double/float value but without the trailing zero added to it.</p>
  <p>I've used NumberFormat, DecimalFormat but once I cast double or float to the result, it will add trailing zero(which is expected). I was wondering if there is a way to prevent this.</p>
  <pre><code>        private Double format (double input) {        
  
          NumberFormat nf = NumberFormat.getIntegerInstance(Locale.US);           
          Double result = null; 
          BigDecimal bd = new BigDecimal(input); 
          
          if(bd.intValue() &gt; 99){
          //(don't want to add trailing zeros here)
                  return (double)bd.intValue();
          }else{
              nf.setMinimumFractionDigits(1);
              nf.setMaximumFractionDigits(1);
              result = Double.parseDouble(nf.format(bd.doubleValue()));
          }
          return result; 
     
  </code></pre>
  <p>P.S. I am not trying to return String value here.</p>