func toFloat(unk interface{}) (float64, error) {
	switch i := unk.(type) {
	case float64:
		return i, nil
	case float32:
		return float64(i), nil
	case int64:
		return float64(i), nil
	case int32:
		return float64(i), nil
	case int:
		return float64(i), nil
	case uint64:
		return float64(i), nil
	case uint32:
		return float64(i), nil
	case uint:
		return float64(i), nil
	case string:
		return math.NaN(), errNotAFloat
	default:
		v := reflect.ValueOf(unk)
		v = reflect.Indirect(v)
		if v.Type().ConvertibleTo(floatType) {
			fv := v.Convert(floatType)
			return fv.Float(), nil
		} else {
			return math.NaN(), errNotAFloat
		}
	}
}
toFloat converts a given interface to a float64 value.
Code from https://stackoverflow.com/questions/20767724/converting-unknown-interface-to-float64-in-golang
working example at https://play.golang.org/p/v-QrbeOWtz
package jolokia
import (
	"math"
	"reflect"
	"encoding/json"
	"errors"
	"strings"
	"regexp"
	"github.com/iancoleman/strcase"
)
var (
	floatType = reflect.TypeOf(float64(0))
	errNotAFloat = errors.New("value is not a float")
	keyRegExp = regexp.MustCompile("[^a-zA-Z0-9_]")
	underscoreRegExp = regexp.MustCompile("[_]{2,}")
)