ChemPal Documentation - v1.18.0
    Preparing search index...

    Function dropPercent

    • How far a price went down.

      Parameters

      Returns number

      The drop as a percentage of the earlier price

      dropPercent({ from: 24, to: 18 }); // 25
      
      export function dropPercent({ from, to }: Pick<PriceDrop, 'from' | 'to'>): number {
      return ((from - to) / from) * 100;
      }