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

Function _format

tools/python-3.11.9-amd64/Lib/locale.py:183–190  ·  view source on GitHub ↗
(percent, value, grouping=False, monetary=False, *additional)

Source from the content-addressed store, hash-verified

181 r'(?P<modifiers>[-#0-9 +*.hlL]*?)[eEfFgGdiouxXcrs%]')
182
183def _format(percent, value, grouping=False, monetary=False, *additional):
184 if additional:
185 formatted = percent % ((value,) + additional)
186 else:
187 formatted = percent % value
188 if percent[-1] in 'eEfFgGdiu':
189 formatted = _localize(formatted, grouping, monetary)
190 return formatted
191
192# Transform formatted as locale number according to the locale settings
193def _localize(formatted, grouping=False, monetary=False):

Callers 3

format_stringFunction · 0.70
formatFunction · 0.70
strFunction · 0.70

Calls 1

_localizeFunction · 0.85

Tested by

no test coverage detected