From 43c6bb8d9e22ea9a2e762c5c76bbe28fc3d651f7 Mon Sep 17 00:00:00 2001 From: Sinh Date: Thu, 3 Nov 2022 10:55:31 +0700 Subject: [PATCH] add set float64 func --- set.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/set.go b/set.go index 3636693..925c561 100644 --- a/set.go +++ b/set.go @@ -1,8 +1,10 @@ package postgresql import ( - "github.com/volatiletech/null/v8" "time" + + "github.com/shopspring/decimal" + "github.com/volatiletech/null/v8" ) func SetString(val string) null.String { @@ -45,3 +47,7 @@ func SetJSON(val []byte) (res null.JSON) { Valid: true, } } + +func SetFloat64(val float64) decimal.Decimal { + return decimal.NewFromFloat(val) +} -- 2.34.1