Your Question

How can I implement precision on decimals(float) using gorm?

type Abc struct { FieldOne float64 gorm:"precision(8,2) // eight digits with 2 decimal places }

The document you expected this should be explained

Expected answer

Comment From: akshay-pj-open

Use column type as numeric(8,2) // Eight digits and Two decimal places.

Example:

type Abc struct {
FieldOne   float64  `gorm:"type:numeric(8,2)"`
}

Comment From: ravenrich

how to define decimal(32,16)?