o a#@s6ddlmZddlmZddlmZ  d ddZdS) )Decimal)settings) mark_safeNFcCsL|s |duo tjo tj}|p|}|o|dk}t|tr#|s#|s#t|Sd}t|tr8dt|vr8t t|}t|t r|durUt dd |d} t || krUt d}| \} } } t | t | dkrd |}|d\} } t| ||||||} d | | Sd |}nt|}|dd krd }|d d}d|vr|d\}}|dur|d|}n|d}}|dur|d|t |}|o||}|r zt|}Wn ty|dg}Ynw|d}d}d}|dddD](}|r||kr|r|dp|}||ddd7}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 ",") Nrrez0.10z{:e}z{}e{}z{:f}-.)rUSE_L10NUSE_THOUSAND_SEPARATOR isinstanceintrfloatstrlowerrrjustabsas_tuplelenformatsplitlist TypeErrorpop)number decimal_sep decimal_posgrouping thousand_sepforce_groupinguse_l10n use_groupingsigncutoff_digitsexponent coefficient str_numberint_partdec_part intervalsactive_interval int_part_gdcntdigitr4;/usr/lib/python3/dist-packages/django/utils/numberformat.pyrsn                  r)NrrFN)decimalr django.confrdjango.utils.safestringrrr4r4r4r5s