Skip to content

User-faceing list of units #18

@emersonthis

Description

@emersonthis

Right now we can get a big list of every unit name with Measurement::Unit.names. Is there a way to do the same thing, but without all the aliases for each? The use case I'm thinking about is a form with a <select> (or whatever) for selecting the units. It would be nice to filter out the repeats (ex: doz vs dozen).

I'm pretty sure I could theoretically simulate this by looping over the entire list and testing conversions between each combination to "reverse-engineer" aliases... but that'd be expensive and messy. Is there a cleaner way to do this? Or perhaps we could add another static method to the class?

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