Home / Function/ ChartTooltipValueFormatter() — supabase Function Reference

ChartTooltipValueFormatter() — supabase Function Reference

Architecture documentation for the ChartTooltipValueFormatter() function in Usage.utils.ts from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  f528da26_53cb_bb06_269c_12d2fbeec3f7["ChartTooltipValueFormatter()"]
  2332ec88_7b4e_b519_2827_c6a73f691f9f["AttributeUsage()"]
  2332ec88_7b4e_b519_2827_c6a73f691f9f -->|calls| f528da26_53cb_bb06_269c_12d2fbeec3f7
  f57e739b_91f0_28ed_a487_c0e0bc3f3715["formatBytesPrecision()"]
  f528da26_53cb_bb06_269c_12d2fbeec3f7 -->|calls| f57e739b_91f0_28ed_a487_c0e0bc3f3715
  style f528da26_53cb_bb06_269c_12d2fbeec3f7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/studio/components/interfaces/Organization/Usage/Usage.utils.ts lines 65–77

export const ChartTooltipValueFormatter = (number: number | string, unit: string) => {
  if (typeof number === 'string') return number

  if (unit === 'bytes') {
    const formattedBytes = formatBytesPrecision(number).replace(/\s/g, '')

    return formattedBytes === '0bytes' ? '0' : formattedBytes
  } else if (unit === 'gigabytes') {
    return compactNumberFormatter.format(number) + 'GB'
  } else {
    return compactNumberFormatter.format(number)
  }
}

Subdomains

Called By

Frequently Asked Questions

What does ChartTooltipValueFormatter() do?
ChartTooltipValueFormatter() is a function in the supabase codebase.
What does ChartTooltipValueFormatter() call?
ChartTooltipValueFormatter() calls 1 function(s): formatBytesPrecision.
What calls ChartTooltipValueFormatter()?
ChartTooltipValueFormatter() is called by 1 function(s): AttributeUsage.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free