DecimalFormat df = new DecimalFormat("0"); try{ System.out.println(df.format(Double.parseDouble(number))); }catch(Exception e){ }