@@ -603,9 +603,9 @@ numbers by creating a ``Encoder`` and specifying ``decimal_format='number'``.
603603 b ' 1.2345'
604604
605605 You may also optionally specify a target precision for rounding
606- Decimal values before encoding using the decimal_quantize parameter.
607- If provided, all decimal.Decimal values will be quantized (rounded)
608- to the same scale as this value using the Decimal.quantize() method.
606+ Decimal values before encoding using the `` decimal_quantize `` parameter.
607+ If provided, all ` decimal.Decimal`` values will be quantized (rounded)
608+ to the same scale as this value using the ` Decimal.quantize() ` method.
609609This is useful for ensuring consistent precision of decimal values
610610during serialization, particularly in financial or monetary contexts.
611611
@@ -618,11 +618,11 @@ during serialization, particularly in financial or monetary contexts.
618618 >> > encoder.encode(decimal.Decimal(" 1.23456789" ))
619619 b ' "1.23"'
620620
621- The optional decimal_rounding parameter allows you to specify
621+ The optional `` decimal_rounding `` parameter allows you to specify
622622the rounding mode to use when quantizing Decimal values. It accepts
623623one of the standard rounding mode strings from Python's decimal module,
624- such as 'ROUND_DOWN' , 'ROUND_HALF_UP' , etc. If not specified,
625- the default rounding mode is used ('ROUND_HALF_EVEN').
624+ such as `` 'ROUND_DOWN' `` , `` 'ROUND_HALF_UP' `` , etc. If not specified,
625+ the default rounding mode is used (`` 'ROUND_HALF_EVEN' `` ).
626626
627627.. code-block :: python
628628
@@ -635,6 +635,7 @@ the default rounding mode is used ('ROUND_HALF_EVEN').
635635 b ' "1.24"'
636636
637637 .. note ::
638+
638639 This parameter has no effect unless ``decimal_quantize `` is also specified.
639640
640641This setting is not yet supported for YAML or TOML - if this option is
0 commit comments