diff --git a/exerr/meta.go b/exerr/meta.go index ea591d8..9279f52 100644 --- a/exerr/meta.go +++ b/exerr/meta.go @@ -9,6 +9,7 @@ import ( "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/bson/primitive" "gogs.mikescher.com/BlackForestBytes/goext/langext" + "math" "strconv" "strings" "time" @@ -667,6 +668,28 @@ func (v MetaValue) rawValueForJson() any { } return v.Value.(EnumWrap).ValueString } + if v.DataType == MDTFloat32 { + if math.IsNaN(float64(v.Value.(float32))) { + return "float64::NaN" + } else if math.IsInf(float64(v.Value.(float32)), +1) { + return "float64::+inf" + } else if math.IsInf(float64(v.Value.(float32)), -1) { + return "float64::-inf" + } else { + return v.Value + } + } + if v.DataType == MDTFloat64 { + if math.IsNaN(v.Value.(float64)) { + return "float64::NaN" + } else if math.IsInf(v.Value.(float64), +1) { + return "float64::+inf" + } else if math.IsInf(v.Value.(float64), -1) { + return "float64::-inf" + } else { + return v.Value + } + } return v.Value } diff --git a/goextVersion.go b/goextVersion.go index 8d8ffdf..0378768 100644 --- a/goextVersion.go +++ b/goextVersion.go @@ -1,5 +1,5 @@ package goext -const GoextVersion = "0.0.379" +const GoextVersion = "0.0.380" -const GoextVersionTimestamp = "2024-01-19T17:30:20+0100" +const GoextVersionTimestamp = "2024-01-22T12:33:41+0100"