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

Function _plain_decimal_text

python/pyfory/converter.py:292–299  ·  view source on GitHub ↗
(value: decimal.Decimal)

Source from the content-addressed store, hash-verified

290
291
292def _plain_decimal_text(value: decimal.Decimal) -> str:
293 value = _canonical_decimal(value)
294 if value.is_zero():
295 return "0"
296 text = format(value, "f")
297 if "." in text:
298 text = text.rstrip("0").rstrip(".")
299 return text
300
301
302def _float_text(value: float) -> str:

Callers 2

_float_textFunction · 0.85
_string_valueFunction · 0.85

Calls 2

_canonical_decimalFunction · 0.85
is_zeroMethod · 0.45

Tested by

no test coverage detected