diff options
| author | Tomasz Buchert | 2011-06-03 10:41:05 +0200 | 
|---|---|---|
| committer | Tomasz Buchert | 2011-06-03 10:41:05 +0200 | 
| commit | ca24b3f27510319319dca205f9c1e9868259e246 (patch) | |
| tree | d7ba79073c63f5fc62e5c8dc5f60a7e7ae1c2d94 | |
| parent | d9a2437e4907d3dc97f5300054700b48387a9502 (diff) | |
| download | django-debug-toolbar-ca24b3f27510319319dca205f9c1e9868259e246.tar.bz2 | |
Proper decimal separator for non-US locales (eg. polish).
| -rw-r--r-- | debug_toolbar/templates/debug_toolbar/panels/sql.html | 3 | ||||
| -rw-r--r-- | debug_toolbar/templatetags/__init__.py | 0 | ||||
| -rw-r--r-- | debug_toolbar/templatetags/debug_toolbar_utils.py | 11 | 
3 files changed, 13 insertions, 1 deletions
| diff --git a/debug_toolbar/templates/debug_toolbar/panels/sql.html b/debug_toolbar/templates/debug_toolbar/panels/sql.html index f6f231c..deb4391 100644 --- a/debug_toolbar/templates/debug_toolbar/panels/sql.html +++ b/debug_toolbar/templates/debug_toolbar/panels/sql.html @@ -1,4 +1,5 @@  {% load i18n %} +{% load debug_toolbar_utils %}  <div class="clearfix">  	<ul class="stats">  		{% for alias, info in databases %} @@ -34,7 +35,7 @@  						</div>  					</td>  					<td class="timeline"> -						<div class="djDebugTimeline"><div class="djDebugLineChart{% if query.is_slow %} djDebugLineChartWarning{% endif %}" style="left:{{ query.start_offset }}%;"><strong style="width:{{ query.width_ratio }}%;">{{ query.width_ratio }}%</strong></div></div> +						<div class="djDebugTimeline"><div class="djDebugLineChart{% if query.is_slow %} djDebugLineChartWarning{% endif %}" style="left:{{ query.start_offset|dotted_number }}%;"><strong style="width:{{ query.width_ratio|dotted_number }}%;">{{ query.width_ratio }}%</strong></div></div>  					</td>  					<td class="time">  						{{ query.duration|floatformat:"2" }} diff --git a/debug_toolbar/templatetags/__init__.py b/debug_toolbar/templatetags/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/debug_toolbar/templatetags/__init__.py diff --git a/debug_toolbar/templatetags/debug_toolbar_utils.py b/debug_toolbar/templatetags/debug_toolbar_utils.py new file mode 100644 index 0000000..6b204eb --- /dev/null +++ b/debug_toolbar/templatetags/debug_toolbar_utils.py @@ -0,0 +1,11 @@ + +from django import template +from django.utils.numberformat import format + +register = template.Library() + +@register.filter +def dotted_number(number): +    number = float(number) +    return format(number, '.', 6) +     | 
