title: Formatting a String to Remove Scientific Notation - Java
body: <p>I have the following code which splits a string of numbers (separated by a space) and then creates an array of floats :</p>
  
  <pre><code>//Split the string and then build a float array with the values.
  String[] tabOfFloatString = value.split(" ");
  int length = tabOfFloatString.length;
  System.out.println("Length of float string is" + length);
  float[] floatsArray = new float[length];
  for (int l=0; l&lt;length; l++) {
  float res = Float.parseFloat(tabOfFloatString[l]);
      System.out.println("Float is " + res);
      floatsArray[l]=res;
  }
  </code></pre>
  
  <p>The problem is that some of the values in the string are formatted with scientific notation - e.g they read -3.04567E-8.</p>
  
  <p>What I want to do is end up with a float which does not contain the E number.</p>
  
  <p>I have been reading this thread which suggests that I could use BigDecimal, however am unable to get this to work - is this the best approach or should I try something else ? <a href="https://stackoverflow.com/questions/1229516/how-to-convert-a-string-3-0103e-7-to-0-00000030103-in-java">How to convert a string 3.0103E-7 to 0.00000030103 in Java?</a></p>