Home / Function/ percentChangeString() — react Function Reference

percentChangeString() — react Function Reference

Architecture documentation for the percentChangeString() function in stats.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  c0a8258c_50c4_e1dd_0a8a_f59d8116aeb8["percentChangeString()"]
  e163a81d_e30a_3a91_8884_38c65b04137f["stats.js"]
  c0a8258c_50c4_e1dd_0a8a_f59d8116aeb8 -->|defined in| e163a81d_e30a_3a91_8884_38c65b04137f
  62bdc62f_756d_2b27_9133_affd98404881["printResults()"]
  62bdc62f_756d_2b27_9133_affd98404881 -->|calls| c0a8258c_50c4_e1dd_0a8a_f59d8116aeb8
  style c0a8258c_50c4_e1dd_0a8a_f59d8116aeb8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

scripts/rollup/stats.js lines 40–51

function percentChangeString(change) {
  if (!isFinite(change)) {
    // When a new package is created
    return 'n/a';
  }
  const formatted = (change * 100).toFixed(1);
  if (/^-|^0(?:\.0+)$/.test(formatted)) {
    return `${formatted}%`;
  } else {
    return `+${formatted}%`;
  }
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does percentChangeString() do?
percentChangeString() is a function in the react codebase, defined in scripts/rollup/stats.js.
Where is percentChangeString() defined?
percentChangeString() is defined in scripts/rollup/stats.js at line 40.
What calls percentChangeString()?
percentChangeString() is called by 1 function(s): printResults.

Analyze Your Own Codebase

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

Try Supermodel Free