Reading Ethereum Balances Safely with Web3.js: Avoiding BigInt Pitfalls
Reading an Ethereum address's balance with web3.eth.getBalance() returns wei as a string. Converting that string to JavaScript Number causes precision loss. Keep it as a string or use BigInt, then convert with web3.utils.fromWei() for display.