Skip to content

Commit

Permalink
chore: remove obsolete format functions
Browse files Browse the repository at this point in the history
  • Loading branch information
enzo-bitfly committed Jan 9, 2025
1 parent 6ebefdd commit 536faa3
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions frontend/utils/format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,6 @@ export function commmifyLeft(value: string): string {
return formatted
}

export function formatAndCalculatePercent(
value?: number,
base?: number,
config?: NumberFormatConfig,
): string {
if (!base) {
return ''
}
return formatPercent(calculatePercent(value, base), config)
}

/**
* Should be used only when you work with a network different from the current one.
* Wherever you would write `formatEpochToDate(currentNetwork.value, ...)` you
Expand Down Expand Up @@ -146,30 +135,6 @@ export function formatNumber(value?: number): string {
return value?.toLocaleString('en-US') ?? ''
}

export function formatPercent(
percent?: number,
config?: NumberFormatConfig,
): string {
if (percent === undefined) {
return ''
}
const {
addPositiveSign, fixed, precision,
} = {
...{
addPositiveSign: false,
fixed: 2,
precision: 2,
},
...config,
}
let result = trim(percent, precision, fixed)
if (addPositiveSign) {
result = addPlusSign(result)
}
return `${result}%`
}

/**
* Should be used only when you work with a network different from the current one.
* Wherever you would write `formatSlotToDateTime(currentNetwork.value, ...)`
Expand Down

0 comments on commit 536faa3

Please sign in to comment.