String Formatting Functions¶
Functions for formatting numerical values into human-readable strings.
Time Formatting¶
format_time_string builtin ¶
Format a time duration in seconds to a human-readable string.
Converts a duration in seconds to either a long format (e.g., "6 minutes and 2.00 seconds") or a short format (e.g., "6m 2s").
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
seconds | float | Time duration in seconds | required |
short | bool | If True, use short format; otherwise use long format (default: False) | False |
Returns:
| Name | Type | Description |
|---|---|---|
str | str | Human-readable string representation of the time duration |