fix: change format number func name

This commit is contained in:
RadoslavDimchev 2023-09-15 18:33:27 +03:00
parent acb6b36649
commit 7cea165151
7 changed files with 13 additions and 13 deletions

View File

@ -2,7 +2,7 @@ import { Separator, XStack, YStack } from 'tamagui'
import { Text } from '@status-im/components'
import { SwapIcon } from '@status-im/icons'
import { formatNumberForGauge } from '../../../utilities'
import { formatNumberWithComa } from '../../../utilities'
import IconText from '../../../components/General/IconText'
type SyncCardContentProps = {
@ -21,7 +21,7 @@ const SyncCardContent = ({ title, value, total }: SyncCardContentProps) => {
<XStack space={'$2'} style={{ padding: '10px 16px 10px 16px' }}>
<IconText icon={<SwapIcon size={16} />}>Syncing</IconText>
<Text size={13}>
{formatNumberForGauge(value)} / {formatNumberForGauge(total)}
{formatNumberWithComa(value)} / {formatNumberWithComa(total)}
</Text>
</XStack>
</YStack>

View File

@ -5,7 +5,7 @@ import Icon from '../../components/General/Icon'
import StandardGauge from '../../components/Charts/StandardGauge'
import IconText from '../../components/General/IconText'
import { TokenIcon } from '@status-im/icons'
import { formatNumberForGauge } from '../../utilities'
import { formatNumberWithComa } from '../../utilities'
interface DeviceStorageHealthProps {
synced: number
@ -72,7 +72,7 @@ const SyncStatusCardConsensus: React.FC<DeviceStorageHealthProps> = ({ synced, t
<XStack space={'$2'} style={{ padding: '10px 16px 10px 16px' }}>
<IconText icon={<TokenIcon size={16} />}>{message}</IconText>
<Text size={13}>
{formatNumberForGauge(synced)} / {formatNumberForGauge(total)}
{formatNumberWithComa(synced)} / {formatNumberWithComa(total)}
</Text>
</XStack>
</YStack>

View File

@ -3,7 +3,7 @@ import { Shadow, Text } from '@status-im/components'
import StandardGauge from '../../components/Charts/StandardGauge'
import IconText from '../../components/General/IconText'
import { TokenIcon } from '@status-im/icons'
import { formatNumberForGauge } from '../../utilities'
import { formatNumberWithComa } from '../../utilities'
interface DeviceStorageHealthProps {
synced: number
@ -73,7 +73,7 @@ const SyncStatusCardExecution: React.FC<DeviceStorageHealthProps> = ({ synced, t
<XStack space={'$2'} style={{ padding: '10px 16px 10px 16px' }}>
<IconText icon={<TokenIcon size={16} />}>{message}</IconText>
<Text size={13}>
{formatNumberForGauge(synced)} / {formatNumberForGauge(total)}
{formatNumberWithComa(synced)} / {formatNumberWithComa(total)}
</Text>
</XStack>
</YStack>

View File

@ -1,7 +1,7 @@
import { Stack, XStack, YStack } from 'tamagui'
import StandardGauge from '../../../components/Charts/StandardGauge'
import { Text } from '@status-im/components'
import { formatNumberForGauge } from '../../../utilities'
import { formatNumberWithComa } from '../../../utilities'
type ActivationSyncCardProps = {
gaugeColor: string
@ -37,7 +37,7 @@ const ActivationSyncCard = ({ gaugeColor, gaugeSynced, gaugeTotal }: ActivationS
</Stack>
<YStack>
<Text size={15} weight={'semibold'}>
{formatNumberForGauge(gaugeSynced)} / {formatNumberForGauge(gaugeTotal)}
{formatNumberWithComa(gaugeSynced)} / {formatNumberWithComa(gaugeTotal)}
</Text>
</YStack>
</XStack>

View File

@ -4,7 +4,7 @@ import { Text } from '@status-im/components'
import StandardGauge from '../../../../components/Charts/StandardGauge'
import BorderBox from '../../../../components/General/BorderBox'
import { formatNumberForGauge } from '../../../../utilities'
import { formatNumberWithComa } from '../../../../utilities'
type KeyGenerationSyncCardProps = {
synced: number
@ -45,7 +45,7 @@ const KeyGenerationSyncCard = ({ synced, total, title, color }: KeyGenerationSyn
{title}
</Text>
<Text size={15} weight={'semibold'}>
{formatNumberForGauge(synced)} / {formatNumberForGauge(total)}
{formatNumberWithComa(synced)} / {formatNumberWithComa(total)}
</Text>
</YStack>
<ClearIcon size={20} color="#A1ABBD" />

View File

@ -4,7 +4,7 @@ import { Text } from '@status-im/components'
import StandardGauge from '../../../../components/Charts/StandardGauge'
import BorderBox from '../../../../components/General/BorderBox'
import { formatNumberForGauge } from '../../../../utilities'
import { formatNumberWithComa } from '../../../../utilities'
type ConsensusGaugeCardProps = {
synced: number
@ -45,7 +45,7 @@ const ConsensusGaugeCard = ({ synced, total, title, color }: ConsensusGaugeCardP
{title}
</Text>
<Text size={15} weight={'semibold'}>
{formatNumberForGauge(synced)} / {formatNumberForGauge(total)}
{formatNumberWithComa(synced)} / {formatNumberWithComa(total)}
</Text>
</YStack>
<ClearIcon size={20} color="#A1ABBD" />

View File

@ -23,6 +23,6 @@ export const convertSecondsToTimerFormat = (seconds: number) => {
return `${String(minutes).padStart(2, '0')}:${String(remainingSeconds).padStart(2, '0')}`
}
export const formatNumberForGauge = (n: number): string => {
export const formatNumberWithComa = (n: number): string => {
return n.toFixed(3).replace(/\./g, ',')
}