title: How to deal with decimal number in scala
body: <p>I have a file like this:</p>
  
  <pre><code>1    4.146846
  2    3.201141
  3    3.016736
  4    2.729412
  </code></pre>
  
  <p>I want to use <code>toDouble</code> but, it's not working as expected :</p>
  
  <pre><code>val rows = textFile.map { line =&gt;  
       val fields = line.split("[^\\d]+") 
       ((fields(0),fields(1).toDouble))     
  }
  
  val Num = rows.sortBy(- _._2).map{case (user , num) =&gt; num}.collect.mkString("::")
  
  println(Num)
  </code></pre>
  
  <p>The result print out is <code>4.0::3.0::3.0::2.0</code>.<br>
  What I expect is  <code>4.146846::3.201141::3.016736::2.729412</code></p>
  
  <p>How do I do this?</p>