Functions
format_number
2
str
▼
Basic number formatting with locale-appropriate separators.
format_number
2
str
▼
def format_number(value: int | float, locale: str = 'en') -> str
Parameters
| Name | Type | Description |
|---|---|---|
value |
int | float |
|
locale |
str |
Default:'en'
|
Returns
str
_add_separator
2
str
▼
Add thousands separator to a string of digits.
_add_separator
2
str
▼
def _add_separator(s: str, sep: str) -> str
Parameters
| Name | Type | Description |
|---|---|---|
s |
str |
|
sep |
str |
Returns
str
format_date
3
str
▼
Basic date formatting.
Formats:
- short: 2024-03-15
- medium: Mar 15, 2024
- l…
format_date
3
str
▼
def format_date(value: datetime.date | datetime.datetime, locale: str = 'en', fmt: str = 'short') -> str
Basic date formatting.
Formats:
- short: 2024-03-15
- medium: Mar 15, 2024
- long: March 15, 2024
Parameters
| Name | Type | Description |
|---|---|---|
value |
datetime.date | datetime.datetime |
|
locale |
str |
Default:'en'
|
fmt |
str |
Default:'short'
|
Returns
str