I have the amount of transfered tokens converted from a transactionreceipts log data.

for example USDT the value I got is 500000000 , USDT has 6 decimals. The actual transfered value is only 500 USDT, how can I convert that using web3 or javascript to use the contracts decimals and output the correct value?

Would amount / math.pow(10, tokendecimals) be the correct way to do this?

Regards