Home / Function/ format_byte_size() — tailwindcss Function Reference

format_byte_size() — tailwindcss Function Reference

Architecture documentation for the format_byte_size() function in throughput.rs from the tailwindcss codebase.

Function rust Oxide Scanner called by 1

Entity Profile

Dependency Diagram

graph TD
  316ccab0_9ed9_c23b_21a5_8aa4ea616aa7["format_byte_size()"]
  6f593478_e4f6_5c15_8be5_fce0e1efa51f["throughput.rs"]
  316ccab0_9ed9_c23b_21a5_8aa4ea616aa7 -->|defined in| 6f593478_e4f6_5c15_8be5_fce0e1efa51f
  b6f5f41d_7476_bdb0_248f_09fb493e0833["fmt()"]
  b6f5f41d_7476_bdb0_248f_09fb493e0833 -->|calls| 316ccab0_9ed9_c23b_21a5_8aa4ea616aa7
  style 316ccab0_9ed9_c23b_21a5_8aa4ea616aa7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

crates/oxide/src/throughput.rs lines 41–52

fn format_byte_size(size: f64) -> String {
    let units = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
    let unit = 1000;
    let mut size = size;
    let mut i = 0;
    while size > unit as f64 {
        size /= unit as f64;
        i += 1;
    }

    format!("{:.2} {}", size, units[i])
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does format_byte_size() do?
format_byte_size() is a function in the tailwindcss codebase, defined in crates/oxide/src/throughput.rs.
Where is format_byte_size() defined?
format_byte_size() is defined in crates/oxide/src/throughput.rs at line 41.
What calls format_byte_size()?
format_byte_size() is called by 1 function(s): fmt.

Analyze Your Own Codebase

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

Try Supermodel Free