MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / format

Function format

tools/python-3.11.9-amd64/Lib/locale.py:250–263  ·  view source on GitHub ↗

Deprecated, use format_string instead.

(percent, value, grouping=False, monetary=False, *additional)

Source from the content-addressed store, hash-verified

248 return new_f % val
249
250def 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
265def currency(val, symbol=True, grouping=False, international=False):
266 """Formats val according to the currency settings

Callers 8

multicolumnMethod · 0.70
__format__Method · 0.70
_format_usageMethod · 0.70
_get_module_detailsFunction · 0.70
format_fieldMethod · 0.70
pyerrors.hFile · 0.50
sysmodule.hFile · 0.50
bytesobject.hFile · 0.50

Calls 4

_formatFunction · 0.70
warnMethod · 0.45
matchMethod · 0.45
groupMethod · 0.45

Tested by

no test coverage detected