Permalink
Browse files

[WebProfilerBundle] changed memory display in the WDT to MB instead o…

…f KB
  • Loading branch information...
1 parent ebc84a7 commit b33dd284dc0115537bea0a8718b4e18f7ed6e774 @fabpot fabpot committed Dec 8, 2011
@@ -5,7 +5,7 @@
<img width="13" height="28" alt="Memory Usage" style="vertical-align: middle; margin-right: 5px;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAcCAYAAAC6YTVCAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJBJREFUeNpi/P//PwOpgImBDDAcNbE4ODiAg+/AgQOC586d+4BLoZGRkQBQ7Xt0mxQIWKCAzXkCBDQJDEBAIHOKiooicSkEBtTz0WQ0xFI5Mqevr285HrUOMAajvb09ySULk5+f3w1SNIDUMwKLsAIg256IrAECoEx6EKQJlLkkgJiDCE0/gPgF4+AuLAECDAAolCeEmdURAgAAAABJRU5ErkJggg=="/>
{% endset %}
{% set text %}
- {{ '%.0f'|format(collector.memory / 1024) }} KB
+ {{ '%.1f'|format(collector.memory / 1024 / 1024) }} MB
{% endset %}
{% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': false } %}
{% endblock %}

2 comments on commit b33dd28

@pgodel
Contributor
pgodel commented on b33dd28 Dec 12, 2011

Have you considered using a size formatter for multiple units (KB, MB, GB, etc) ? We have a twig filter for this I can share.

@fabpot
Member
fabpot commented on b33dd28 Dec 12, 2011

no because in this specific case, MB is always the best choice.

Please sign in to comment.