diff --git a/new-lamassu-admin/src/pages/Accounting/Accounting.js b/new-lamassu-admin/src/pages/Accounting/Accounting.js
index 86d5a539..1af4dbc7 100644
--- a/new-lamassu-admin/src/pages/Accounting/Accounting.js
+++ b/new-lamassu-admin/src/pages/Accounting/Accounting.js
@@ -45,6 +45,9 @@ const mockData = [
}
]
+const formatCurrency = amount =>
+ amount.toLocaleString('en-US', { maximumFractionDigits: 2 })
+
const useStyles = makeStyles(styles)
const Assets = ({ balance, hedgingReserve, currency }) => {
@@ -56,7 +59,7 @@ const Assets = ({ balance, hedgingReserve, currency }) => {
Pazuz fiat balance
- {balance.toLocaleString('en-US', { maximumFractionDigits: 2 })}
+ {formatCurrency(balance)}
{currency}
@@ -68,9 +71,7 @@ const Assets = ({ balance, hedgingReserve, currency }) => {
Hedging reserve
- {hedgingReserve.toLocaleString('en-US', {
- maximumFractionDigits: 2
- })}
+ {formatCurrency(hedgingReserve)}
{currency}
@@ -82,9 +83,7 @@ const Assets = ({ balance, hedgingReserve, currency }) => {
Available balance
- {(balance - hedgingReserve).toLocaleString('en-US', {
- maximumFractionDigits: 2
- })}
+ {formatCurrency(balance - hedgingReserve)}
{currency}
@@ -123,14 +122,18 @@ const Accounting = () => {
size: 'sm',
textAlign: 'right',
view: it =>
- `${it.direction === 'in' ? it.amount : -it.amount} ${it.currency}`
+ `${
+ it.direction === 'in'
+ ? formatCurrency(it.amount)
+ : formatCurrency(-it.amount)
+ } ${it.currency}`
},
{
header: 'Balance after operation',
width: 250,
size: 'sm',
textAlign: 'right',
- view: it => `${it.balanceAfterTx} ${it.currency}`
+ view: it => `${formatCurrency(it.balanceAfterTx)} ${it.currency}`
},
{
header: 'Date',