Type cast in _stats.html.erb