Math#

Small numeric helpers in richy.core.math. The module is intentionally tiny – it’s a parking lot for one-off calculations shared across apps.

calc_percentage_change#

Returns the percentage change from a starting value to an ending value as a float. Used everywhere a “% change” is rendered – performance charts, share-price percentage columns, drawdown, etc.

richy.core.math.calc_percentage_change(end, start)[source]#

Calculates percentage difference between initial value (start) and final value (end).

Parameters:
  • end (int) – Final value.

  • start (int) – Initial value.

Returns:

Calculated percentage change.

Return type:

float