Skip to content

Relative percentage ratio change
@localizer/format 1.0.1

relativePercent ( value: number | bigint , reference: number | bigint )

  • value - The value to format.
  • reference - The reference value.

Both arguments can be either a Number or a BigInt.

This formatter calculates the percentage change between a value and a reference in a locale-aware manner.

NOTE

Unlike percent and percentRange, this formatter accepts arbitrary numerical values and computes the percentage change internally.

Examples: