Skip to content

Rounding makes the pass/fail appear incorrect #229

@jamesnw

Description

@jamesnw

Example- https://www.oddcontrast.com/#hsl__hsl(196.31_8.1868~_39.763~)__hsl(299_44~_91.5~)

It has a ratio of 4.498..., which rounds to 4.5. 4.5 is displayed, but the pass/fail is determined based on the full number.

Some options-

  1. Pass/fail based on the rounded number instead of the full number, which gives less precision (but are they actually significant digits? Probably not)
  2. Display a "floor" instead of a rounded number, in which case the example would show 4.49. This maintains that the ratio is not actually passing, but the value is more incorrect.
  3. Catch cases where this happens, and show the ratio to more digits, and not round. Always correct, always in sync, but adds more variation to the ratio length.

I guess the question is - do we care more about the pass fail or the ratio being accurate? Or make it a bit more complex and go with option #3?

We may also want to always show 2 digits after the decimal. This doesn't solve this issue, but would make the design more stable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions