From 10131922815f8681c5fb0205f5f7fa36cd6ef7cf Mon Sep 17 00:00:00 2001 From: jahooma Date: Sat, 8 Jan 2022 12:14:20 -0600 Subject: [PATCH] Show the floor of your balance --- functions/src/scripts/recalculate-contract-totals.ts | 3 ++- web/components/bet-panel.tsx | 5 ++++- web/components/profile-menu.tsx | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/functions/src/scripts/recalculate-contract-totals.ts b/functions/src/scripts/recalculate-contract-totals.ts index d1b33bb4..d691db36 100644 --- a/functions/src/scripts/recalculate-contract-totals.ts +++ b/functions/src/scripts/recalculate-contract-totals.ts @@ -7,7 +7,8 @@ type DocRef = admin.firestore.DocumentReference // Generate your own private key, and set the path below: // https://console.firebase.google.com/u/0/project/mantic-markets/settings/serviceaccounts/adminsdk -const serviceAccount = require('../../../../Downloads/dev-mantic-markets-firebase-adminsdk-sir5m-b2d27f8970.json') +// const serviceAccount = require('../../../../Downloads/dev-mantic-markets-firebase-adminsdk-sir5m-b2d27f8970.json') +const serviceAccount = require('../../../../Downloads/mantic-markets-firebase-adminsdk-1ep46-820891bb87.json') admin.initializeApp({ credential: admin.credential.cert(serviceAccount), diff --git a/web/components/bet-panel.tsx b/web/components/bet-panel.tsx index 347e398f..abc9764e 100644 --- a/web/components/bet-panel.tsx +++ b/web/components/bet-panel.tsx @@ -126,7 +126,10 @@ export function BetPanel(props: { contract: Contract; className?: string }) { Amount{' '} {user && ( - {formatMoney(remainingBalance > 0 ? remainingBalance : 0)} left + {formatMoney( + remainingBalance > 0 ? Math.floor(remainingBalance) : 0 + )}{' '} + left )} diff --git a/web/components/profile-menu.tsx b/web/components/profile-menu.tsx index 9186568b..97c73ffa 100644 --- a/web/components/profile-menu.tsx +++ b/web/components/profile-menu.tsx @@ -73,7 +73,9 @@ function ProfileSummary(props: { user: User }) {
{user.name} -
{formatMoney(user.balance)}
+
+ {formatMoney(Math.floor(user.balance))} +
)