TezTech / eztz

Tezos JS Library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question about mutez and totez formatting

samyoungnyc opened this issue · comments

This isn't an issue - I'm looking for clarification. In main.js there are two formatters for Tezos values and I am a bit confused.

In the utility object, the two formatters are:

totez: m => parseInt(m) / 1000000,
mutez: function(tz) {
    return new BN(new BN(tz).toFixed(6)).multipliedBy(1000000).toString();
},

I am sending successful transfers using eztz.rpc.transfer - the values I supply for the transactions are floats like 4.1 or 0.1. These are accurately outputting the correct amount of xtz taking place in the transfer (taking place through a Ledger integration on my front-end).

I am confused because although it works and the values match up (4.1xtz), it seems in this case that neither totez or mutez formatters are being used. Any ideas on what I'm missing here?