Skip to content

Potential bug when processing units #29

Description

@roughhawkbit

In utils.UnitConverter.time() we check whether the time unit is in fact a denominator rather than a numerator, and act upon it, by:
if (timeUnit.contains(unit+"-1")) {out = 1d/out;}
Which makes perfect sense, and the equivalent process is also in the mass converter.

However, in the length and volume converters we check only for the negative:
if (lengthUnit.contains(unit+"-")) {out = 1d/out;}
This is fragile and a potential source of errors!

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