private static function convertValueForDisplay($value, $format, $unit)
 {
     if ($format == "number") {
         return $value . $unit;
     }
     if ($format == "time") {
         return ConversionHelpers::ToTime($value);
     }
     if ($format == "date") {
         return date('Y-m-d', $value);
     }
     //todo: might be wrong, needs to go into converseion helper and needs a test
     if ($format == "metric") {
         return ConversionHelpers::ToMetric($value);
     }
     if ($format == "currency") {
         return ConversionHelpers::ToCurrency($value);
     }
 }
Ejemplo n.º 2
0
 public function testToMetric()
 {
     $this->assertEquals('123.0k', ConversionHelpers::ToMetric(123000));
     $this->assertEquals('123.456m', ConversionHelpers::ToMetric(123456000));
 }
Ejemplo n.º 3
0
 private static function convertValueForDisplay($value, $format, $unit)
 {
     if ($format == "number") {
         return $value . $unit;
     }
     if ($format == "time") {
         return ConversionHelpers::ToTime($value);
     }
     if ($format == "date") {
         return $this->ToDate($value);
     }
     if ($format == "metric") {
         return ConversionHelpers::ToMetric($value);
     }
     if ($format == "currency") {
         return ConversionHelpers::ToCurrency($value);
     }
 }