Skip to main content

MonetizationEvent.assetScale

Caution

The assetScale property is deprecated. Please consider using the amountSent property of the MonetizationEvent interface instead.

The assetScale property of the MonetizationEvent interface returns the scale of the paid amount.

Value

An integer that represents the scale on the amount of money received in the last payment.

Examples

<link rel="monetization" href="https://example.com/pay" />
<script>
const link = document.querySelector('link[rel="monetization"]')
link.addEventListener('monetization', (event) => {
// See how much your received and in what currency
const { amount, assetCode, assetScale } = event
console.log(`Browser sent ${assetCode}${amount / Math.pow(10, assetScale)}.`)
})
</script>

Specifications

Browser compatibility