Server : Apache System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64 User : dh_edsupp ( 6597262) PHP Version : 8.2.26 Disable Function : NONE Directory : /lib/python3/dist-packages/django/utils/__pycache__/ |
Upload File : |
o �a# � @ s6 d dl mZ d dlmZ d dlmZ d dd�ZdS ) � )�Decimal)�settings)� mark_safeN� Fc C sL |s |du ot jot j}|p|}|o|dk}t| t�r#|s#|s#t| �S d}t| t�r8dt| ��� v r8t t| ��} t| t �r�|durUt dd� |d� �} t| �| k rUt d�} | �� \} }}t|�t |� dkr�d �| �} | �d�\} }t| ||||||�} d �| |�S d�| �}nt| �}|d dkr�d}|d d� }d|v r�|�d�\}}|dur�|d|� }n|d}}|dur�|d|t |� }|o�|| }|�r zt|�}W n ty� |dg}Y nw |�d�}d}d}|ddd� D ](}|�r||k�r|�r|�d��p|}||ddd� 7 }d}||7 }|d 7 }q�|ddd� }|| | S )aT Get a number (as a number or string), and return it as a string, using formats defined as arguments: * decimal_sep: Decimal separator symbol (for example ".") * decimal_pos: Number of decimal positions * grouping: Number of digits in every group limited by thousand separator. For non-uniform digit grouping, it can be a sequence with the number of digit group sizes following the format used by the Python locale module in locale.localeconv() LC_NUMERIC grouping (e.g. (3, 2, 0)). * thousand_sep: Thousand separator symbol (for example ",") Nr r �ez0.�1�0�� z{:e}z{}e{}z{:f}�-� �.���)r �USE_L10N�USE_THOUSAND_SEPARATOR� isinstance�intr �float�str�lowerr �rjust�abs�as_tuple�len�format�split�list� TypeError�pop)�number�decimal_sep�decimal_pos�grouping�thousand_sep�force_grouping�use_l10n�use_grouping�sign�cutoff�_�digits�exponent�coefficient� str_number�int_part�dec_part� intervals�active_interval�int_part_gd�cnt�digit� r4 �;/usr/lib/python3/dist-packages/django/utils/numberformat.pyr sn �� � r )Nr r FN)�decimalr �django.confr �django.utils.safestringr r r4 r4 r4 r5 �<module> s �