Skip to content

Support for '%' presentation type in mpf.__format__ #837

@javierelpianista

Description

@javierelpianista

I've been working on these presentation types, to complete the set.
'%' is straightforward, just multiply the mpf by 100 and add a % sign at the end.

'n' is a lot trickier, since some locales may be difficult to program.
For instance,

>>> import locale
>>> locale.setlocale(locale.LC_ALL, 'en_IN.utf8')
>>> print('{:.10n}'.format(100000.25))
1,00,000.25

Would a partial implementation of 'n' (i.e., only care about thousands and decimal separators) be useful or should we not bother at all with it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementnew feature requests (or implementation)

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions