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
>>> from gmpy2 import*
>>> f"{mpfr('123.456'):=.5g}"
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: Invalid conversion specification
>>> f"{float(mpfr('123.456')):=.5g}"# works for python floats
'123.46'
I think we should be compatible with python floats here, meaning '=' is: "Forces the padding to be placed after the sign (if any) but before the digits. This is used for printing fields in the form ‘+000000120’. This alignment option is only valid for numeric types. It becomes the default for numbers when ‘0’ immediately precedes the field width."
The text was updated successfully, but these errors were encountered:
skirpichev
changed the title
Invalid conversion specification (ValueError) for align '=' value in format spec
"Invalid conversion specification" error for align '=' value in format spec
Aug 6, 2024
I think we should be compatible with python floats here, meaning '=' is: "Forces the padding to be placed after the sign (if any) but before the digits. This is used for printing fields in the form ‘+000000120’. This alignment option is only valid for numeric types. It becomes the default for numbers when ‘0’ immediately precedes the field width."
The text was updated successfully, but these errors were encountered: