indutny / bn.js

BigNum in pure javascript
MIT License
1.19k stars 150 forks source link

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

Open tungleanh92 opened 2 years ago

tungleanh92 commented 2 years ago

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?