Introducción a Zend Framework

 Aprendiendo Zend Framework

Apéndice

 Referencia de Zend Framework


  • Zend_Gdata
  • Zend_Http
  • Zend_InfoCard
  • Zend_Json
  • Zend_Layout
  • Zend_Ldap
  • Zend_Loader
  • Zend_Locale
  • Zend_Log
  • Zend_Mail
  • Zend_Markup
  • Zend_Measure
  • Zend_Memory
  • Zend_Mime
  • Zend_Navigation
  • Zend_Oauth
  • Zend_OpenId
  • Zend_Paginator
  • Zend_Pdf
  • Zend_ProgressBar
  • Zend_Queue
  • Zend_Reflection
  • Zend_Registry
  • Zend_Rest

  • Zend_Search_Lucene
  • Zend_Serializer
  • Zend_Server
  • Zend_Service
  • Zend_Session
  • Zend_Soap
  • Zend_Tag
  • Zend_Test
  • Zend_Text
  • Zend_TimeSync
  • Zend_Tool
  • Zend_Tool_Framework
  • Zend_Tool_Project
  • Zend_Translate
  • Zend_Uri
  • Zend_Validate
  • Zend_Version
  • Zend_View
  • Zend_Wildfire
  • Zend_XmlRpc
  • ZendX_Console_Process_Unix
  • ZendX_JQuery
  • Traducción al 26.9% - Actualizado el 2011-11-16 - Revisión 24249 - Versión ZF 1.11.x

    25.5. Where is the currency?

    The position where the currency sign or name will be displayed depends on the locale. Still, when you want to define this setting yourself you have to use the display option and provide one of the following constants:

    Tabla 25.2. Available positions for the currency

    Constant Description
    STANDARD Sets the standard position as defined within the locale
    RIGHT Displays the currency representation at the right side of the value
    LEFT Displays the currency representation at the left side of the value

    Ejemplo 25.4. Setting the currency position

    Let's assume that your client has again set "en_US" as locale. Using no option the returned value could look like this:

    $currency = new Zend_Currency(
        array(
            
    'value' => 100,
        )
    );

    print 
    $currency// Could return '$ 100'

    So by using the default setting the currency (in our case $) could either be rendered left or right from the value. Now let's define a fixed position:

    $currency = new Zend_Currency(
        array(
            
    'value'    => 100,
            
    'position' => Zend_Currency::RIGHT,
        )
    );

    print 
    $currency// Could return '100 $';

    Note that in the second snippet the position of USD is fixed regardless of the used locale or currency.


    digg delicious meneame google twitter technorati facebook

    Comentarios

    Loading...