applyTagFormat applies a named format (number, cost, filesize) to baseValue.
(val reflect.Value, format, baseValue string)
| 573 | |
| 574 | // applyTagFormat applies a named format (number, cost, filesize) to baseValue. |
| 575 | func applyTagFormat(val reflect.Value, format, baseValue string) string { |
| 576 | switch format { |
| 577 | case "number": |
| 578 | return applyNumberFormat(val, baseValue) |
| 579 | case "cost": |
| 580 | return applyCostFormat(val, baseValue) |
| 581 | case "filesize": |
| 582 | return applyFilesizeFormat(val, baseValue) |
| 583 | } |
| 584 | return baseValue |
| 585 | } |
| 586 | |
| 587 | // applyNumberFormat formats a value as a human-readable number (e.g., "1k", "1.2M"). |
| 588 | func applyNumberFormat(val reflect.Value, baseValue string) string { |
no test coverage detected