Formats decimal ratios as percentage strings

Converts raw decimal values (0-1) to percentage strings with consistent decimal precision for display in statistics views. Maintains uniform presentation across all percentage metrics.

Examples:

  • 0.756 → "75.6%"
  • 0.25 → "25.0%"
  • 1.0 → "100.0%"
export const formatPercent = (value: number) => {
return `${(value * 100).toFixed(1)}%`;
};
  • Parameters

    • value: number

      Decimal value between 0 and 1

    Returns string

    Formatted percentage string with one decimal place