Skip to content

[minor] Correct mph display #8

@NJAldwin

Description

@NJAldwin

I noticed the speed in the FP Camera seemed to be slightly off from what other data is showing. I traced it back to the UI here:

const toMph = (s: number) => Math.round(s * 1.26) + " mph";
const toKmh = (s: number) => Math.round(s * 1.8) + " km/h";

It's converting the game's speed unit (m/s * 2) to km/h with the formula I'd expect (1 m/s = 3.6 km/h, so * 1.8 works), but the mph calculation is off. Per Google, it should be 1 m/s = 2.237 mph, so this should multiply by 1.11847 to get the correct mph.

Looks like the 1.26 factor has been around since mph was introduced: f3f1955

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions