We'll show you how to use the correct rounding in emitting QP event fields of the type number.
In the following example, we see the field product.price.value
with the value 66
. This value must be rounded to a maximum of 2 decimal places, so 66
and 66.00
are both valid rounding examples.
uv.emit('ecProduct', {
eventType: 'listing',
product: {
sku: 'sso-154',
productId: '120039504',
name: 'Blue sweater',
price: {
currency: 'GBP',
value: 66
}
}
})
Please refer to the following examples.
price: {
value: 55,
currency: "USD"
}
price: {
value: 55.55,
currency: "USD"
}
Too many numbers after .
:
price: {
value: 55.555,
currency: "USD"
}