bn.js icon indicating copy to clipboard operation
bn.js copied to clipboard

Property 'divmod' does not exist on type 'BN'

Open tungleanh92 opened this issue 3 years ago • 0 comments

export const toUnit = async (balance: any) => { let curConfig: Config = getConfig(); const api = await setupProviderApi(curConfig); let decimals = api.registry.chainDecimals; let base = new BN(10).pow(new BN(decimals)); //I'm using typescript and it return the error at this line let dm = new BN(balance).divmod(base); return parseFloat(dm.div.toString() + "." + dm.mod.toString()) } How can I fix this?

tungleanh92 avatar Aug 02 '22 09:08 tungleanh92