Skip to content

Tag: pint

Format Pint unit as short-form symbol

Say I have an arbitrary Pint quantity q. Is there a way to display its units in symbol short form, instead of as a full-length word? In other words, how would I code unit_symbol() such that it returns “m”, not “meter”; “kg” not “kilogram”; etc.? Is there a way t…