$readable = $this->getLanguageInstance()->getMessage('null_timestamp');
} else {
switch ($this->getLanguageInstance()->getLanguageCode()) {
- case "de": // German format is a bit different to default
+ case 'de': // German format is a bit different to default
// Split the GMT stamp up
$dateTime = explode(' ', $timestamp );
$dateArray = explode('-', $dateTime[0]);
default: // Default is pass-through
$readable = $timestamp;
break;
- }
+ } // END - switch
}
// Return the stamp
return $readable;
}
+ /**
+ * Filter a given number into a localized number
+ *
+ * @param $value The raw value from e.g. database
+ * @return $localized Localized value
+ */
+ public function doFilterFormatNumber ($value) {
+ // Generate it from config and localize depencies
+ switch ($this->getLanguageInstance()->getLanguageCode()) {
+ case 'de': // German format is a bit different to default
+ $localized = number_format($value, $this->getConfigInstance()->readConfig('decimals'), ',', '.');
+ break;
+
+ default: // US, etc.
+ $localized = number_format($value, $this->getConfigInstance()->readConfig('decimals'), '.', ',');
+ break;
+ } // END - switch
+
+ // Return it
+ return $localized;
+ }
+
/**
* "Getter" for databse entry
*
// CFG: PRODUCT-INSTALL-MODE
$cfg->setConfigEntry('product_install_mode', 'debug');
+// CFG: DECIMALS
+$cfg->setConfigEntry('decimals', 3);
+
// [EOF]
?>