Gorm Float64
type TableName struct {
Amount decimal.Decimal `json:"amount" sql:"type:decimal(20,8);"`
}
Restu Wahyu Saputra
type TableName struct {
Amount decimal.Decimal `json:"amount" sql:"type:decimal(20,8);"`
}
type Product struct {
decimal.Decimal `gorm:"type:decimal(7,6);"`
}
type Product struct {
Id int
ProductName string `sql:"type:varchar(250);"`
Amount float32 `sql:"type:decimal(10,2);"`
}
type MyStruct struct {
Name string `json:"name" gorm:"not null"`
Description string `json:"description" gorm:"null"`
Price decimal.Decimal `json:"price" gorm:"type:numeric"`
}