You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Quantity.to_string() should allow unicode format #14386
EDIT: A tricky bit is that for inline=False, i.e., when the units are typeset as a fraction, one needs to add the correct number of spaces, otherwise one still gets what used to happen with __format__ (#14398):
import astropy.units as u
q = 10*u.m/u.s
print(f"{q:unicode}")
10.0 m
─
s
Also not obvious is what should happen for the case that the quantity is an array; but at least inline=True should be possible.
EDIT (2024-01-11): the :unicode formatting now typesets the unit in-line, so it is less broken, though numbers in arrays are not typeset using unicode, unlike for latex.
Activity