public function cut_title($text, $limit = 25)
 {
     $val = cstr($text, 0, $limit);
     return $val[1] ? $val[0] : $val[0];
 }
Example #2
0
function formatNumber($content, $n)
{
    $dianLeft = "";
    $dianRight = "";
    $i = "";
    $c = "";
    $s = "";
    $content = cstr($content);
    if (inStr($content, ".") > 0) {
        $dianLeft = mid($content, 1, inStr($content, ".") - 1);
        $dianRight = mid($content, inStr($content, ".") + 1, -1);
    } else {
        $dianLeft = $content;
    }
    $dianRight = $dianRight . "0000000000";
    for ($i = 1; $i <= $n; $i++) {
        $s = mid($dianRight, $i, 1);
        $c = $c . $s;
    }
    if ($n > 0) {
        $dianLeft = $dianLeft . ".";
    }
    $test = $dianLeft . $c;
    return @$formatNumber;
}