slate/common/filecoin.js

13 lines
401 B
JavaScript
Raw Normal View History

2020-11-26 02:53:25 +03:00
import { FilecoinNumber, Converter } from "@glif/filecoin-number";
export const formatAsFilecoinConversion = (number) => {
const filecoinNumber = new FilecoinNumber(`${number}`, "attofil");
//const inAttoFil = filecoinNumber.toAttoFil();
const inFil = filecoinNumber.toFil();
return `${formatAsFilecoin(inFil)}`;
};
export const formatAsFilecoin = (number) => {
return `${number} FIL`;
};