title: How can we truncate float64 type to a particular precision?
body: <pre><code>package main
  
  import (
      "fmt"
      "strconv"
      )
  
  func main() {
      k := 10/3.0
      i := fmt.Sprintf("%.2f", k)
      f,_ := strconv.ParseFloat(i, 2)
      fmt.Println(f)
  }
  </code></pre>
  
  <p>I had to write the program above to decrease the precision of a go float64 variable to 2. 
  In this case I was using both strconv and fmt. Is there some other logical method by which it can be done?</p>