@bluefin-exchange/bluefin7k-aggregator-sdk
Version:
10 lines (9 loc) • 334 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.formatBalance = formatBalance;
function formatBalance(balance, decimals) {
const exp = BigInt(Math.pow(10, decimals));
const whole = balance / exp;
const remain = balance % exp;
return Number(whole) + Number(remain) / Number(exp);
}
;