MCPcopy Create free account
hub / github.com/apache/arrow / format

Method format

cpp/gdb_arrow.py:916–924  ·  view source on GitHub ↗

Format as a decimal number with the given precision and scale.

(self, precision, scale)

Source from the content-addressed store, hash-verified

914 return v
915
916 def format(self, precision, scale):
917 """
918 Format as a decimal number with the given precision and scale.
919 """
920 v = int(self)
921 with decimal.localcontext() as ctx:
922 ctx.prec = precision
923 ctx.capitals = False
924 return str(decimal.Decimal(v).scaleb(-scale))
925
926
927class Decimal128(BaseDecimal):

Callers 15

test_format_propertyMethod · 0.45
test_format_propertyMethod · 0.45
test_formatMethod · 0.45
test_formatMethod · 0.45
read_tableFunction · 0.45
decoratorFunction · 0.45
_deprecate_apiFunction · 0.45
__instancecheck__Method · 0.45
core.pyFile · 0.45

Calls 1

DecimalMethod · 0.45

Tested by 15

test_format_propertyMethod · 0.36
test_format_propertyMethod · 0.36
test_formatMethod · 0.36
test_formatMethod · 0.36
test_hdfs_optionsFunction · 0.36
format_msgMethod · 0.36
test_partition_discoveryFunction · 0.36