Deprecated, use format_string instead.
(percent, value, grouping=False, monetary=False, *additional)
| 248 | return new_f % val |
| 249 | |
| 250 | def format(percent, value, grouping=False, monetary=False, *additional): |
| 251 | """Deprecated, use format_string instead.""" |
| 252 | import warnings |
| 253 | warnings.warn( |
| 254 | "This method will be removed in a future version of Python. " |
| 255 | "Use 'locale.format_string()' instead.", |
| 256 | DeprecationWarning, stacklevel=2 |
| 257 | ) |
| 258 | |
| 259 | match = _percent_re.match(percent) |
| 260 | if not match or len(match.group())!= len(percent): |
| 261 | raise ValueError(("format() must be given exactly one %%char " |
| 262 | "format specifier, %s not valid") % repr(percent)) |
| 263 | return _format(percent, value, grouping, monetary, *additional) |
| 264 | |
| 265 | def currency(val, symbol=True, grouping=False, international=False): |
| 266 | """Formats val according to the currency settings |
no test coverage detected