OwlCyberSecurity - MANAGER
Edit File: numberformat.cpython-39.pyc
a kH�f� � @ s2 d dl mZ d dlmZ d dlmZ d dd�ZdS ) � )�Decimal)�settings)� mark_safeN� Fc C sv | du s| dkrt | �S |s*|du o.tjo.tj}|p6|}|oB|dk}t| t�r^|s^|s^t | �S d}t| t�r�dt| ��� v r�t t| ��} t| t ��r,|dur�t dd� |d� �} t| �| k r�t d�} | �� \} }}t|�t |� dk�r d �| �} | �d�\} }t| ||||||�} d �| |�S d�| �}nt| �}|d dk�rRd}|d d� }d|v �r�|�d�\}}|du�r�|d|� }n |d }}|du�r�|d|t |� 7 }|�o�|| }|�rjzt|�}W n t�y� |dg}Y n0 |�d�}d}d}|ddd� D ]R}|�rH||k�rH|�r2|�d��p0|}||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 r ZUSE_L10NZUSE_THOUSAND_SEPARATOR� isinstance�int�float�str�lowerr �rjust�abs�as_tuple�len�format�split�list� TypeError�pop)�numberZdecimal_sepZdecimal_pos�groupingZthousand_sepZforce_groupingZuse_l10nZuse_grouping�sign�cutoff�_�digits�exponentZcoefficientZ str_numberZint_partZdec_partZ intervalsZactive_intervalZint_part_gdZcnt�digit� r$ �[/home/gouroczh/virtualenv/test/3.9/lib/python3.9/site-packages/django/utils/numberformat.pyr s~ �� � r )Nr r FN)�decimalr Zdjango.confr Zdjango.utils.safestringr r r$ r$ r$ r% �<module> s �