progress value/max Percent

Resolves progress from parsed value/max: absent value is indeterminate, nonpositive max defaults to 1, and value is clamped into [0,max]. Indeterminate percent is represented as 0 with its explicit flag.

Description

Progress represents task completion against a maximum.

Progress represents task completion against a maximum. Without a value it is indeterminate, so its numeric placeholder should not be mistaken for measured zero progress.1

Resolves progress from parsed value/max: absent value is indeterminate, nonpositive max defaults to 1, and value is clamped into [0,max]. Indeterminate percent is represented as 0 with its explicit flag.

When to use progress value/max Percent

Use this for the following task: Resolves progress from parsed value/max: absent value is indeterminate, nonpositive max defaults to 1, and value is clamped into [0,max]. Indeterminate percent is represented as 0 with its explicit flag.

Prepare the parsed attribute values, element states or ordered local lists requested below. Keep attribute presence separate from value.

How to use progress value/max Percent and understand its results

  1. Prepare the parsed attribute values, element states or ordered local lists requested below. Keep attribute presence separate from value.
  2. Enter hasValue, value, max using the field table, then run the tool.
  3. Read indeterminate, effectiveMax, effectiveValue, percent. Interpret flags, units, ordering and placeholder values using the rules below.
  4. Review any reported issue or failed check, correct the supplied values when appropriate, and verify the result in its intended context.
Input fieldMeaningValue type and boundsRequirement
hasValueHas ValuebooleanRequired
valueValuenumberRequired
maxMaxnumberRequired

Supply parsed value/max and the value-presence flag. Default nonpositive max to 1; clamp present values, or return effectiveValue 0 and indeterminate true when value is absent.2

effectiveMax = max > 0 ? max : 1; percent = 100 × clamp(value, 0, effectiveMax) / effectiveMax

This summarizes the declared operation. Units, indexing, inclusivity and exceptional cases are explained in the surrounding text.

Output fieldMeaningValue type
indeterminateIndeterminateboolean
effectiveMaxEffective Maxnumber
effectiveValueEffective Valuenumber
percentPercentnumber
json
{
  "input": {
    "hasValue": true,
    "value": 3,
    "max": 8
  },
  "output": {
    "indeterminate": false,
    "effectiveMax": 8,
    "effectiveValue": 3,
    "percent": 37.5
  }
}

Limitations and assumptions

Percent 0 for an indeterminate result is a placeholder. This does not track a real task or read markup.

This evaluates supplied local information; it does not fetch a page or run a browser. Malformed requests produce input errors. A successfully evaluated request can still contain false flags, empty result lists or a result outside the supplied threshold; those outcomes have the meanings stated above.

Alternative or Complementary methods

Choose meter optimum low/high Band Classifier for this operation: Classifies a meter value against caller-supplied normalized min/low/high/max bounds and optimum. Value and optimum are clamped; optimum on a low/high boundary selects the middle optimum region. For a complementary task, use required/readonly/disabled Diff Table for this operation: Resolves required, readonly and disabled flags for an ordinary input type. Effective disabled includes inherited fieldset state supplied by the caller. Submission eligibility concerns disabling only; name, checkedness and submitter selection are separate.

Further background: HTML / accessibility reference: progress value/max Percent.

References

  1. HTML / accessibility reference: progress value/max Percent — WHATWG

  2. progress value/max Percent — tool.io

Similar or alternative tools

  • meter optimum low/high Band Classifier

    Classifies a meter value against caller-supplied normalized min/low/high/max bounds and optimum. Value and optimum are clamped; optimum on a low/high boundary selects the middle optimum region.

  • required/readonly/disabled Diff Table

    Resolves required, readonly and disabled flags for an ordinary input type. Effective disabled includes inherited fieldset state supplied by the caller. Submission eligibility concerns disabling only; name, checkedness and submitter selection are separate.

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies