title: How to sort Scala maps by value in ascending order?
body: <p>I have a map like so: </p>
  
  <pre><code>var map:Map[String, Double] = Map(
   "1" -&gt; 4.6, 
   "2" -&gt; 2.1, 
   "3" -&gt; 3.4, 
   "4" -&gt; 0.3
  )
  </code></pre>
  
  <p>I would like to sort it by values in the ascending order so as to get the following output after printing each key value pair in the map: </p>
  
  <pre><code>(4,0.3)
  (2,2.1)
  (3,3.4)
  (1,4.6)
  </code></pre>
  
  <p>How can I do this? Obviously the sorted method doesn't exist so I'd have to convert the Map to another data type and work from there.</p>