File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
app/[locale]/what-is-ether/_components Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1- import { getTranslations } from "next-intl/server"
1+ import { getLocale , getTranslations } from "next-intl/server"
22
33import {
44 Table ,
@@ -9,10 +9,13 @@ import {
99 TableRow ,
1010} from "@/components/ui/table"
1111
12+ import { formatSmallUSD } from "@/lib/utils/numbers"
13+
1214const GasTable = async ( ) => {
1315 const t = await getTranslations ( {
1416 namespace : "page-what-is-ether" ,
1517 } )
18+ const locale = await getLocale ( )
1619
1720 const etherscanApiKey = process . env . ETHERSCAN_API_KEY
1821
@@ -30,7 +33,7 @@ const GasTable = async () => {
3033 const calculateCost = ( gasUnits : number ) => {
3134 const costInETH = gasUnits * gasPrice * 1e-9 // Convert gwei to ETH
3235 const costInUSD = costInETH * ethPriceUSD
33- return `$ ${ costInUSD . toFixed ( 2 ) } `
36+ return formatSmallUSD ( costInUSD , locale )
3437 }
3538
3639 return (
You can’t perform that action at this time.
0 commit comments