make correct representation of decimals in bigint

Signed-off-by: Uncle Fatso <uncle.fatso@ghostchain.io>
This commit is contained in:
Uncle Fatso 2025-08-21 16:21:51 +03:00
parent f34d53a936
commit 9ab91c801d
Signed by: f4ts0
GPG Key ID: 565F4F2860226EBB
2 changed files with 2 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{
"name": "ghost-lite",
"version": "0.1.3",
"version": "0.1.4",
"description": "Web application for Ghost and Casper chain.",
"author": "Uncle f4ts0 <f4ts0@ghostchain.io>",
"maintainers": [

View File

@ -85,8 +85,7 @@ const Item: React.FC<ItemProps> = (props) => {
if (!value || !decimals) {
return parseFloat("0").toFixed(5)
}
const power = Math.pow(10, decimals)
const number = Number(value / BigInt(power))
const number = Number(value) / Math.pow(10, decimals)
return parseFloat(number.toString()).toFixed(5)
}