hay alguna manera de reemplazar esto:
<div>{math equation="x - y" x={$n.total_rating} y={$n.total_ratings}}</div>
Donde los resultados son, por ejemplo, 1300 para recibir estos 1.3k , y así sucesivamente...
Pruebe en libs\plugins\modifier.num_format.php
<?php /** * Smarty plugin * * @package Smarty * @subpackage PluginsModifier */ function smarty_modifier_num_format($string) { if($string>1000) { $x = round($string); $x_number_format = number_format($x); $x_array = explode(',', $x_number_format); $x_parts = array('k', 'm', 'b', 't'); $x_count_parts = count($x_array) - 1; $x_display = $x; $x_display = $x_array[0] . ((int) $x_array[1][0] !== 0 ? '.' . $x_array[1][0] : ''); $x_display .= $x_parts[$x_count_parts - 1]; return $x_display; } return $string; }
y en el archivo del tema
{assign var="mynubers" value="{math equation="x - y" x={$n.total_rating} y={$n.total_ratings}}"} {if $mynubers > '1000'}{$mynubers|num_format}{else}{$mynubers}{/if}