ویرگول
ورودثبت نام
مهران میرزایی
مهران میرزاییMikroTik Certified Consultant (MTCNA , MTCWE)
مهران میرزایی
مهران میرزایی
خواندن ۱ دقیقه·۵ سال پیش

نمایش 2رقم اعشار در تمپلیت جنگو

برای اعمال فیلتر بر روی عدد اعشاری در قالب جنگو میتوان از روش زیر استفاده کرد

The floatformat filter takes an n argument for the number of decimal places to round to. Without that argument, it will round to one decimal place unless the decimal value is 0, in which case it will just output the integer.

{{ i|floatformat }}

{{ i|floatformat:2 }}

{{ i|floatformat:0 }}


django
۱
۰
مهران میرزایی
مهران میرزایی
MikroTik Certified Consultant (MTCNA , MTCWE)
شاید از این پست‌ها خوشتان بیاید