diff --git a/satellite/payments/balance.go b/satellite/payments/balance.go
index 86c26b6ee..8bef2ae01 100644
--- a/satellite/payments/balance.go
+++ b/satellite/payments/balance.go
@@ -13,7 +13,7 @@ type Balance struct {
FreeCredits int64 `json:"freeCredits"`
Coins decimal.Decimal `json:"coins"` // STORJ token balance from storjscan.
Credits decimal.Decimal `json:"credits"`
- // Credits is the balance from stripe. This may include the following.
+ // Credits is the balance (in cents) from stripe. This may include the following.
// 1. legacy Coinpayments deposit.
// 2. legacy credit for a manual STORJ deposit.
// 4. bonus manually credited for a storjscan payment once a month before invoicing.
diff --git a/web/satellite/src/components/account/billing/billingTabs/Overview.vue b/web/satellite/src/components/account/billing/billingTabs/Overview.vue
index 617a5f738..6019e4487 100644
--- a/web/satellite/src/components/account/billing/billingTabs/Overview.vue
+++ b/web/satellite/src/components/account/billing/billingTabs/Overview.vue
@@ -46,9 +46,9 @@
-
+
-
${{ balance.credits }}
+
{{ balance.formattedCredits }}
Legacy STORJ Payments and Bonuses
diff --git a/web/satellite/src/types/payments.ts b/web/satellite/src/types/payments.ts
index 2bcafb42e..007e5d677 100644
--- a/web/satellite/src/types/payments.ts
+++ b/web/satellite/src/types/payments.ts
@@ -1,6 +1,8 @@
// Copyright (C) 2019 Storj Labs, Inc.
// See LICENSE for copying information.
+import { formatPrice, decimalShift } from '@/utils/strings';
+
/**
* Exposes all payments-related functionality
*/
@@ -126,7 +128,7 @@ export class AccountBalance {
public freeCredits: number = 0,
// STORJ token balance from storjscan.
private _coins: string = '0',
- // STORJ balance from stripe. This may include the following.
+ // STORJ balance (in cents) from stripe. This may include the following.
// 1. legacy Coinpayments deposit.
// 2. legacy credit for a manual STORJ deposit.
// 4. bonus manually credited for a storjscan payment once a month before invoicing.
@@ -138,13 +140,17 @@ export class AccountBalance {
return parseFloat(this._coins);
}
- public get credits(): number {
- return parseFloat(this._credits);
+ public get formattedCredits(): string {
+ return formatPrice(decimalShift(this._credits, 2));
}
public get sum(): number {
return this.freeCredits + this.coins;
}
+
+ public hasCredits(): boolean {
+ return parseFloat(this._credits) !== 0;
+ }
}
export class CreditCard {