MCPcopy Index your code
hub / github.com/lxn/walk / SetPrecision

Method SetPrecision

tableviewcolumn.go:134–153  ·  view source on GitHub ↗

SetPrecision sets the number of decimal places for formatting float32, float64 or big.Rat values.

(precision int)

Source from the content-addressed store, hash-verified

132// SetPrecision sets the number of decimal places for formatting float32,
133// float64 or big.Rat values.
134func (tvc *TableViewColumn) SetPrecision(precision int) (err error) {
135 if precision == tvc.precision {
136 return nil
137 }
138
139 old := tvc.precision
140 defer func() {
141 if err != nil {
142 tvc.precision = old
143 }
144 }()
145
146 tvc.precision = precision
147
148 if tvc.tv == nil {
149 return nil
150 }
151
152 return tvc.tv.Invalidate()
153}
154
155// Title returns the (default) text to display in the column header.
156func (tvc *TableViewColumn) Title() string {

Callers 1

CreateMethod · 0.95

Calls 1

InvalidateMethod · 0.65

Tested by

no test coverage detected