(p float64)
| 205 | } |
| 206 | |
| 207 | func (widget *Widget) formatPercent(p float64) string { |
| 208 | switch widget.settings.showPercentage { |
| 209 | case "left": |
| 210 | return fmt.Sprintf("%.0f%% ", p*100) |
| 211 | case "right": |
| 212 | return fmt.Sprintf(" %.0f%%", p*100) |
| 213 | case "none": |
| 214 | return "" |
| 215 | default: |
| 216 | return fmt.Sprintf("%.0f%%", p*100) |
| 217 | } |
| 218 | } |
| 219 | |
| 220 | func (widget *Widget) calcBarWidth(percent string) int { |
| 221 | _, _, width, _ := widget.View.GetInnerRect() |