code: func niceNum(val float64, round bool) float64 {
  	var nf float64
  
  	exp := int(math.Floor(math.Log10(val)))
  	f := val / math.Pow10(exp)
  	if round {
  		switch {
  		case f < 1.5:
  			nf = 1
  		case f < 3.0:
  			nf = 2
  		case f < 7.0:
  			nf = 5
  		default:
  			nf = 10
  		}
  	} else {
  		switch {
  		case f <= 1:
  			nf = 1
  		case f <= 2.0:
  			nf = 2
  		case f <= 5.0:
  			nf = 5
  		default:
  			nf = 10
  		}
  	}
  	return nf * math.Pow10(exp)
  }
docs: // niceNum returns a "nice" number approximately equal to x. The number is
  // rounded if round is true, converted to its ceiling otherwise.