Method: EvmClient::Formatter#from_wei

Defined in:
lib/evm_client/formatter.rb

#from_wei(amount, unit = "ether") ⇒ Object


79
80
81
82
# File 'lib/evm_client/formatter.rb', line 79

def from_wei(amount, unit = "ether")
  return nil if amount.nil?
  (BigDecimal(amount, 16) / BigDecimal(UNITS[unit.to_sym], 16)).to_s rescue nil
end