diff --git a/map.go b/map.go index e091acf..c418fbe 100644 --- a/map.go +++ b/map.go @@ -267,3 +267,20 @@ func (m Map) GetInt64(field string) (int64, error) { int64Res := AnyDataType(val).ToString().ToInt64() return int64Res.Value, int64Res.Err } + +// GetFloat64 获取float64值 +// +// 参数说明: +// - field : 要查找的字段 +// +// Author : go_developer@163.com<白茶清欢> +// +// Date : 15:18 2024/11/21 +func (m Map) GetFloat64(field string) (float64, error) { + val, err := m.Get(field) + if nil != err { + return 0, err + } + float64Res := AnyDataType(val).ToString().ToFloat64() + return float64Res.Value, float64Res.Err +}