From 05c6623e63d028610bb8db1fdffa6bcebf669446 Mon Sep 17 00:00:00 2001 From: Alexis Sellier Date: Mon, 8 Mar 2021 12:04:50 +0100 Subject: [PATCH] Move balance formatting to utils --- src/Header.svelte | 5 +---- src/base/vesting/vesting.js | 10 ++++------ src/utils.js | 5 +++++ 3 files changed, 10 insertions(+), 10 deletions(-) create mode 100644 src/utils.js diff --git a/src/Header.svelte b/src/Header.svelte index 27c7ebdaf..5cdb01fbc 100644 --- a/src/Header.svelte +++ b/src/Header.svelte @@ -3,6 +3,7 @@ // TODO: Link to correct network on etherscan import { ethers } from "ethers"; import { link } from "svelte-routing"; + import { formatBalance } from "@app/utils"; import { CONNECTION, session, connectWallet, disconnectWallet, shortAddress } from "./session.js"; import { error } from './error.js'; import Logo from './Logo.svelte'; @@ -10,10 +11,6 @@ let sessionButton = null; let sessionButtonHover = false; - - function formatBalance(balance) { - return ethers.utils.commify(ethers.utils.formatUnits(balance)); - }