diff --git a/site/src/lib/format.ts b/site/src/lib/format.ts index ab61a320ea..b970186585 100644 --- a/site/src/lib/format.ts +++ b/site/src/lib/format.ts @@ -1,6 +1,9 @@ export const toFixedPoint = (value: bigint, decimals: number) => { - let right = BigInt(value) % BigInt(10 ** decimals); - let left = BigInt(value) - right; + console.log("value: " + value) + let right = BigInt(value) % BigInt(10) ** BigInt(decimals); + console.log("right: " + right) + let left = BigInt(value) / BigInt(10) ** BigInt(decimals); + console.log("left: " + left) return left.toString().concat('.', right.toString().padStart(decimals, '0')); };