MCPcopy Create free account
hub / github.com/apache/fory / _string_value

Function _string_value

python/pyfory/converter.py:316–325  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

314
315
316def _string_value(value) -> str:
317 if type(value) is bool:
318 return "true" if value else "false"
319 if type(value) is int:
320 return str(value)
321 if type(value) is float:
322 return _float_text(value)
323 if isinstance(value, decimal.Decimal):
324 return _plain_decimal_text(value)
325 raise ValueError(f"expected scalar value, got {type(value)!r}")
326
327
328def _numeric_value(value, local_type_id: int):

Callers 1

Calls 2

_float_textFunction · 0.85
_plain_decimal_textFunction · 0.85

Tested by

no test coverage detected