Precision of CPQ Values

Precision of CPQ Values

Input fields of type number, decimal, currency, and percent can have a precision specified. The default precision for number fields is 0, while other field types are 2. To change the precision, use the property:

Code snippet

 property ‘cpq-<field-type>-precision'

For example, to set the cpq-currency precision to two decimal places, and cpq-quantity precision to three decimal places, use the following properties.

Code snippet

    <prop key="cpq-currency-precision">4</prop>
    <prop key="cpq-quantity-precision">3</prop>

In addition, you need to specify an additional ADL property:

Code snippet

    <prop key="cpq-decimal-precision">5</prop>

Note: Precision
if you set cpq-quantity-precision to a value larger than its default, you should also set cpq-decimal-precision as well.

The CPQ tables only support a maximum of 5 digits of precision for stored numeric fields in CPQ objects such as products and prices. Any value above 5 will be truncated to 5 digits of precision.

Read-only numbers will use the precision to determine the number of fractional digits to display. The precision must be non-negative integer.

The step is used to set the step attribute. If set to 0, then decimal values cannot be entered. If a precision but not a step is specified, the step will be computed from the precision 1/(10^precision). On the other hand, If a step but not a precision is specified, the precision is determined from the step by counting the number of digits it sees in the step after the decimal point.