add set float64 func #6

Merged
sinhluu merged 1 commits from add-set-float64 into master 2022-11-03 03:55:53 +00:00
1 changed files with 7 additions and 1 deletions
Showing only changes of commit 43c6bb8d9e - Show all commits

8
set.go
View File

@ -1,8 +1,10 @@
package postgresql package postgresql
import ( import (
"github.com/volatiletech/null/v8"
"time" "time"
"github.com/shopspring/decimal"
"github.com/volatiletech/null/v8"
) )
func SetString(val string) null.String { func SetString(val string) null.String {
@ -45,3 +47,7 @@ func SetJSON(val []byte) (res null.JSON) {
Valid: true, Valid: true,
} }
} }
func SetFloat64(val float64) decimal.Decimal {
return decimal.NewFromFloat(val)
}