MAIDR JavaScript API
    Preparing search index...

    Function percentileLabel

    • Names a quantile by its percentile, which is the number a reader can place.

      Trailing zeros are trimmed rather than fixed, so the common rungs read as "25th" and "75th" rather than "25.0th" while a deep one still reads as "0.39th" instead of rounding to "0th" -- and rounding a deep rung to zero would name several different rungs identically, which is exactly the part of the distribution a letter-value plot exists to separate.

      The upper tail is the same problem against 100, so the precision follows the distance to whichever end is nearer: three significant digits of it, on both sides. Three significant digits of the percentile itself named the 99.95th and the 99.98th both "100th", a percentile the drawn outliers above them showed was not reached. So "0.0244th" now pairs with "99.9756th", and "6.25th" with "93.75th", the two ends of one rung.

      Parameters

      • fraction: number

        A quantile, from 0 to 1

      Returns string

      Its percentile, as text