Learn R Programming

ethr (version 0.9.12)

ethCon: Convert Ethereum Denominations

Description

Convert Ethereum Denominations

Usage

ethCon(x, from, to)

Arguments

x
numeric, number to be converted
from
character, 2 letter short notation to convert from (see details)
to
character, 2 letter short notation to convert to (see details)

Value

mpfr converted value (see details)

Details

This function returns a Multiple Precision Floating-Point Reliable number (implemented by the Rmpfr package). This is to allow for the conersion of very high values of Wei into other forms. This can then be converted to numeric, integer or double as required at the expense of accuracy. WARNING do not use this in calculating values to transact actual ether as the precision is not guaranteed currently. This is intended for indicative conversions when parsing data from the Ethereum blockchain.

Denomination short codes: wei = we, Kwei = kw, Mwei = mw, Gwei = gw szabo = sz, finney = fi, ether = et Kether = ke, Mether = me,Gether = ge, Tether = te

Examples

Run this code
ethCon(15000000000000000, "we", "et")
ethCon(1000000000, "et", "me")

Run the code above in your browser using DataLab