SetPrecision sets the number of decimal places for formatting float32, float64 or big.Rat values.
(precision int)
| 132 | // SetPrecision sets the number of decimal places for formatting float32, |
| 133 | // float64 or big.Rat values. |
| 134 | func (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. |
| 156 | func (tvc *TableViewColumn) Title() string { |