mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 09:05:06 -07:00
fix numbers returned from query as string
This commit is contained in:
@@ -205,14 +205,14 @@ export class ClientStatisticsService {
|
|||||||
if (time < 1) {
|
if (time < 1) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return (latestStat.shares * 4294967296) / (time / 1000);
|
return (parseFloat(latestStat.shares) * 4294967296) / (time / 1000);
|
||||||
} else {
|
} else {
|
||||||
const secondLatestStat = result[1];
|
const secondLatestStat = result[1];
|
||||||
const time = new Date(latestStat.updatedAt).getTime() - new Date(secondLatestStat.createdAt).getTime();
|
const time = new Date(latestStat.updatedAt).getTime() - new Date(secondLatestStat.createdAt).getTime();
|
||||||
if (time < 1) {
|
if (time < 1) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return ((latestStat.shares + secondLatestStat.shares) * 4294967296) / (time / 1000);
|
return ((parseFloat(latestStat.shares) + parseFloat(secondLatestStat.shares)) * 4294967296) / (time / 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user