Skip to content

adding units #20

@maadcoen

Description

@maadcoen

Hi!

I was wondering whether it wouldn't make sense to add unit support to the Number class, so that you can do something like this:

distance = Number(1, 0.1, unit="m")
distance.str() # -> "1 +-0.1 m"
distance.unit # -> "m"

This is in any case useful to make the numbers more meaningful and might also be used to throw errors when trying to add / subtract numbers with different units from one another.

cheers

Maarten

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