I have the following lines in my code:
$currency = new Zend_Currency('en_US');
$letter->TRIP_COST = $currency->toCurrency((float) $trip['ProgramCost']);
The value of $trip['ProgramCost'] is '350.0000', which is coming from
a SQL Server smallmoney column. I'm not sure why it comes into PHP as
a string, unless it is to preserve the four-digit decimal precision.
In any event, I am explicitly casting the value as a float since that
is what the Zend_Currency::toCurrency() method requires.
For some reason, it is throwing the following exception:
Unknown number format type 'boolean'. Format '' must be a valid number
format string.
#0 C:\ZendFramework\library\1.9\Zend\Locale\Format.php(297):
Zend_Locale_Format::_checkOptions(Array)
#1 C:\ZendFramework\library\1.9\Zend\Currency.php(152):
Zend_Locale_Format::toNumber(350, Array)
#2 W:\Intranet\lib\site\application\controllers\RegisterController.php(380):
Zend_Currency->toCurrency(350)
#3 W:\Intranet\lib\site\application\controllers\RegisterController.php(317):
RegisterController->assignToTrip(Object(Default_Model_Student), Array,
Object(Default_Model_Letter), NULL, NULL, '')
#4 C:\ZendFramework\library\1.9\Zend\Controller\Action.php(513):
RegisterController->tripSelectAction()
#5 C:\ZendFramework\library\1.9\Zend\Controller\Dispatcher\Standard.php(289):
Zend_Controller_Action->dispatch('tripSelectActio...')
#6 C:\ZendFramework\library\1.9\Zend\Controller\Front.php(946):
Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http),
Object(Zend_Controller_Response_Http))
#7 W:\Intranet\root\site\index.php(176): Zend_Controller_Front->dispatch()
#8 {main}
Andrew