Skip to content

Commit

Permalink
Merge pull request #1615 from ecency/bugfix/engine-estimates
Browse files Browse the repository at this point in the history
Fixed hive engine estimates calculation
  • Loading branch information
feruzm authored Jun 10, 2024
2 parents 86319fc + 6c6f649 commit 1bac5b3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/common/components/engine-tokens-estimated/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, useEffect } from "react";
import React, { useEffect, useState } from "react";
import { _t } from "../../i18n";
import { getMetrics } from "../../api/hive-engine";

Expand Down Expand Up @@ -30,13 +30,13 @@ export const EngineTokensEstimated = (props: any) => {
? Number(pricePerHive * w.balance)
: w.lastPrice === 0
? 0
: Number(w.lastPrice * pricePerHive * w.balance);
: Number((w.lastPrice ?? 0) * pricePerHive * w.balance);
});

const totalWalletUsdValue = tokens_usd_prices.reduce((x: any, y: any) => {
const totalValue = +(x + y).toFixed(3);
return totalValue;
}, 0);
const totalWalletUsdValue = tokens_usd_prices.reduce(
(x: any, y: any) => +(x + y).toFixed(3),
0
);
const usd_total_value = totalWalletUsdValue.toLocaleString("en-US", {
style: "currency",
currency: "USD"
Expand Down

0 comments on commit 1bac5b3

Please sign in to comment.