|
@@ -114,6 +114,20 @@ func (s Map) Int32(key string, defaultVal int) int {
|
|
return defaultVal
|
|
return defaultVal
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+func (s Map) Float32(key string, defaultVal float32) float32 {
|
|
|
|
+ if iface, check := s[key]; check {
|
|
|
|
+ return val(iface, defaultVal).Interface().(float32)
|
|
|
|
+ }
|
|
|
|
+ return defaultVal
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+func (s Map) Float64(key string, defaultVal float64) float64 {
|
|
|
|
+ if iface, check := s[key]; check {
|
|
|
|
+ return val(iface, defaultVal).Interface().(float64)
|
|
|
|
+ }
|
|
|
|
+ return defaultVal
|
|
|
|
+}
|
|
|
|
+
|
|
// Value returns interface object with attempt to convert to defaultVal type.
|
|
// Value returns interface object with attempt to convert to defaultVal type.
|
|
// If key isn't defined will be returned defaultVal arg value
|
|
// If key isn't defined will be returned defaultVal arg value
|
|
func (s Map) Value(key string, defaultVal interface{}) interface{} {
|
|
func (s Map) Value(key string, defaultVal interface{}) interface{} {
|