Skip to content

Unexpected result converting to canonical type #21

@labkey-matthewb

Description

@labkey-matthewb
    Decimal m = ucum.convert(new Decimal("1",15), "[mi_i]","m");
    System.out.println("one mile = " + m + "m expect 1609.344");

Internally convert() first correctly converts 1[mi_i] to canonical unit [m] as 1609.344 but the
conversion from canonical [m] to destination type [m] converts 1609.344 to 1609 because
the identity conversion m->m uses Decimal("1",precision=1)

I would expect the unity conversion to be a noop.

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