You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
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?
The text was updated successfully, but these errors were encountered: