Ejemplo n.º 1
0
 /**
  * Creates a new number format instance. The constructor can be instantiated
  * with a string that represent a culture/locale. Similarly, passing
  * a sfCultureInfo or sfNumberFormatInfo instance will instantiated a instance
  * for that particular culture.
  *
  * @param mixed $formatInfo either null, a sfCultureInfo, a sfNumberFormatInfo, or string
  * @return sfNumberFormat
  */
 function __construct($formatInfo = null)
 {
     if (null === $formatInfo) {
         $this->formatInfo = sfNumberFormatInfo::getInvariantInfo();
     } else {
         if ($formatInfo instanceof sfCultureInfo) {
             $this->formatInfo = $formatInfo->sfNumberFormat;
         } else {
             if ($formatInfo instanceof sfNumberFormatInfo) {
                 $this->formatInfo = $formatInfo;
             } else {
                 $this->formatInfo = sfNumberFormatInfo::getInstance($formatInfo);
             }
         }
     }
 }