update
This commit is contained in:
32
core/plugins/Smarty/modifier.renderValue.php
Normal file
32
core/plugins/Smarty/modifier.renderValue.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* renderuje wartość
|
||||
*
|
||||
* @param $str
|
||||
* @return unknown_type
|
||||
*/
|
||||
|
||||
function smarty_modifier_renderValue(Stat $value){
|
||||
|
||||
if(!is_a($value,'Stat'))return '-';
|
||||
|
||||
|
||||
$valObj = $value -> GetValue();
|
||||
|
||||
if($valObj->GetValue() == '-0')return '-';
|
||||
$val = $valObj->GetValue();
|
||||
if(empty($val))return '-';
|
||||
|
||||
switch($value->GetDisplayType()) {
|
||||
case Stat::STAT_DISPLAY_PERCENT:
|
||||
return sprintf('%s%%',$valObj->GetValue());
|
||||
break;
|
||||
case Stat::STAT_DISPLAY_REAL:
|
||||
return sprintf('%0.2f',$valObj->GetValue());
|
||||
break;
|
||||
default:
|
||||
return $valObj->GetValue();
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user