← Back
Editing: formatters.cpython-311.pyc
� {� g� � �� � d Z dZdZddlZ G d� d� � Z ej d� � Z ej d� � Z G d � d e� � Ze dk r�d#d�Z e dddd�� � e dddd�� � e dddd�� � e dddd�� � e ddd� � e ddd� � e ddd� � e ddd� � e ddd� � e ddd� � e dd d� � e d!d"d� � dS dS )$)� Formatter�DecimalFormatterz3.3.0z] These help format numbers and dates in a user friendly way. Used by the graphics framework. � Nc �* � e Zd ZdZd� Zd� Zd� Zd� ZdS )r z5Base formatter - simply applies python format stringsc � � || _ d S �N��pattern)�selfr s �:/usr/lib/python3/dist-packages/reportlab/lib/formatters.py�__init__zFormatter.__init__ s � ������ c � � | j |z S r r )r �objs r �formatzFormatter.format s � ��|�c�!�!r c �0 � | j j �d| j �d�S )Nz('z'))� __class__�__name__r �r s r �__repr__zFormatter.__repr__ s � �!�^�4�4�4�d�l�l�l�C�Cr c �, � | � |� � S r )r )r �xs r �__call__zFormatter.__call__ s � ��{�{�1�~�~�r N)r � __module__�__qualname__�__doc__r r r r � r r r r sY � � � � � �;�;�� � �"� "� "�D� D� D�� � � � r r z^\d*\.z0+$c �, � e Zd ZdZd d�Zd� Zd� Zd� ZdS ) r z�lets you specify how to build a decimal. A future NumberFormatter class will take Microsoft-style patterns instead - "$#,##0.00" is WAY easier than this.� �.Nc �r � |dk r | j | _ n|| _ || _ || _ || _ || _ d S )N�auto)�_calcPlaces� calcPlaces�places�dot�comma�prefix�suffix)r r$ � decimalSep�thousandSepr'