package attribute import ( "math" ) //εŸΊε‡†ε€ζ•° const CARDINAL_NUMBER int = 10000 func NewFixedPoint(value float32) *FixedPoint { return &FixedPoint{ rawValue: int(math.Round(float64(value * float32(CARDINAL_NUMBER)))), } } type FixedPoint struct { rawValue int scalar float32 } func (this *FixedPoint) Scalar() float32 { return this.scalar * 0.0001 }