diff options
Diffstat (limited to 'protected/components/Format.php')
| -rw-r--r-- | protected/components/Format.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/protected/components/Format.php b/protected/components/Format.php index 1be259f..a4802e2 100644 --- a/protected/components/Format.php +++ b/protected/components/Format.php @@ -8,8 +8,12 @@ class Format { return Yii::app()->locale->numberFormatter->formatDecimal($value).' '.$einheit; } - public static function decimal($value) { + public static function decimal($value, $pattern = null) { + if ($pattern !== null) { return Yii::app()->locale->numberFormatter->formatDecimal($value); + } else { + return Yii::app()->locale->numberFormatter->format($pattern, $value); + } } public static function percentage($value) { |
