Skip to content

Commit b9cb2b1

Browse files
authored
Merge pull request docker#1288 from dgageot/improve-cost-display
Fix inconsistent decimal formatting in cost dialog
2 parents b5192e0 + a6e1cf2 commit b9cb2b1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/tui/dialog/cost.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,10 +345,10 @@ func formatCostPadded(cost float64) string {
345345
if cost < 0.0001 {
346346
return "$0.0000"
347347
}
348-
if cost < 1 {
348+
if cost < 0.01 {
349349
return fmt.Sprintf("$%.4f", cost)
350350
}
351-
return fmt.Sprintf("$%.2f", cost)
351+
return fmt.Sprintf("$%.2f ", cost)
352352
}
353353

354354
func formatTokenCount(count int64) string {

0 commit comments

Comments
 (0)