summaryrefslogtreecommitdiff
path: root/protected/components/Format.php
blob: 129a29249576a3238ec54299148ba0e33c48c262 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php
class Format {
	public static function currency($value, $currency = 'EUR') {
		return Yii::app()->locale->numberFormatter->formatCurrency($value, $currency);
	}
	
	public static function number($value, $einheit = '') {
		return Yii::app()->locale->numberFormatter->formatDecimal($value).' '.$einheit;
	}
	
	public static function decimal($value) {
		return Yii::app()->locale->numberFormatter->formatDecimal($value);
	}
	
	public static function percentage($value) {
		return Yii::app()->locale->numberFormatter->formatPercentage($value);
	}
}