formatUnits static method
Returns a String representation of value
formatted with unit
digits (if it is a number) or to the unit
specified (if a string).
final oneGwei = "1000000000"; final oneEther = "1000000000000000000";
EthUtils.formatUnits(oneGwei, 0); // '1000000000'
EthUtils.formatUnits(oneGwei, "gwei"); // '1.0'
EthUtils.formatUnits(oneGwei, 9); // '1.0'
EthUtils.formatUnits(oneEther); // '1.0'
EthUtils.formatUnits(oneEther, 18); // '1.0'
Implementation
external static String formatUnits(String value, [dynamic unit = 'ether']);