diff --git a/airtime_mvc/application/forms/GeneralPreferences.php b/airtime_mvc/application/forms/GeneralPreferences.php index 9bca14349..76144df05 100644 --- a/airtime_mvc/application/forms/GeneralPreferences.php +++ b/airtime_mvc/application/forms/GeneralPreferences.php @@ -15,7 +15,7 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm $defaultFade = Application_Model_Preference::GetDefaultFade(); if ($defaultFade == "") { - $defaultFade = '0.500000'; + $defaultFade = '0.5'; } //Station name @@ -37,8 +37,8 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm 'required' => false, 'filters' => array('StringTrim'), 'validators' => array(array('regex', false, - array('/^[0-9]{1,2}(\.\d{1,6})?$/', - 'messages' => 'enter a time in seconds 0{.000000}'))), + array('/^[0-9]{1,2}(\.\d{1})?$/', + 'messages' => 'enter a time in seconds 0{.0}'))), 'value' => $defaultFade, 'decorators' => array( 'ViewHelper' diff --git a/airtime_mvc/application/models/Preference.php b/airtime_mvc/application/models/Preference.php index e65151ce4..115ea4aa0 100644 --- a/airtime_mvc/application/models/Preference.php +++ b/airtime_mvc/application/models/Preference.php @@ -189,8 +189,8 @@ class Application_Model_Preference $fade = self::getValue("default_fade"); if ($fade === "") { - // the default value of the fade is 00.500000 - return "00.500000"; + // the default value of the fade is 00.5 + return "00.5"; } // we need this function to work with 2.0 version on default_fade value in cc_pref @@ -204,9 +204,9 @@ class Application_Model_Preference $fade = $out; } - $fade = number_format($fade, 6); + $fade = number_format($fade, 2); //fades need 2 leading zeros for DateTime conversion - $fade = str_pad($fade, 9, "0", STR_PAD_LEFT); + $fade = rtrim(str_pad($fade, 5, "0", STR_PAD_LEFT), "0"); return $fade; }