Skip to content

[Bug]: qualifying_gap in timing tables shows unformatted float (e.g. 0.23399999999999999) #918

Open

Description

@masilu77

Prerequisites

  • I am running the latest version of F1 Sensor
  • I have searched existing issues
  • I have restarted Home Assistant
  • All information in this issue, including logs and screenshots, is written in English.

F1 Sensor Version

6.0.0 (also checked the code of v6.1.0-beta.4: unchanged)

Component

New modular Live Data Card

Device

Any (it is in the card's rendering code, not device specific)

Home Assistant Installation Type

Home Assistant OS

System Architecture

Raspberry Pi 4 (aarch64), Home Assistant 2026.10.2

Screenshot or Screen Recording

No response

Current Behavior

In a timing module with the qualifying_gap field, the gap is shown as the raw JavaScript float of the subtraction, e.g. 0.23399999999999999 instead of +0.234.

data.js computes row.qualifying_gap = currentPartTime - fastestPartTime (a plain number), but cell(row, id) in modular/view.js has no branch for seconds_delta fields, so it falls through to return row[id] ?? '—';. The seconds_delta formatting with formatDelta() only exists in resultCell(), which the timing table does not use.

Module config used:

type: timing
fields: [position, driver, last_lap, qualifying_gap, q1_time, q2_time, q3_time, tyre, status]
options:
  profile: custom
  sort: position

Expected Behavior

qualifying_gap (and any other seconds_delta field in a timing table) formatted like elsewhere, e.g. +0.234. A possible fix in cell():

if (this.field(id)?.type === 'seconds_delta') return row[id] == null ? '—' : html`<span class="time">${formatDelta(row[id])}</span>`;

Logs

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cardLive data card related

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions