2525
2626/**
2727 * sfNumberFormat class.
28- *
28+ *
2929 * sfNumberFormat formats decimal numbers in any locale. The decimal
3030 * number is formatted according to a particular pattern. These
3131 * patterns can arise from the sfNumberFormatInfo object which is
3535 * <code>
3636 * //create a invariant number formatter.
3737 * $formatter = new sfNumberFormat();
38- *
38+ *
3939 * //create a number format for the french language locale.
4040 * $fr = new sfNumberFormat('fr');
4141 *
4242 * //create a number format base on a sfNumberFormatInfo instance $numberInfo.
4343 * $format = new sfNumberFormat($numberInfo);
4444 * </code>
4545 *
46- * A normal decimal number can also be displayed as a currency
46+ * A normal decimal number can also be displayed as a currency
4747 * or as a percentage. For example
4848 * <code>
4949 * $format->format(1234.5); //Decimal number "1234.5"
5555 * to format the number as Japanese Yen:
5656 * <code>
5757 * $ja = new sfNumberFormat('ja_JP');
58- *
58+ *
5959 * //Japanese currency pattern, and using Japanese Yen symbol
6060 * $ja->format(123.14,'c','JPY'); //ï¿?123 (Yen 123)
6161 * </code>
6262 * For each culture, the symbol for each currency may be different.
63- *
63+ *
6464 * @author Xiang Wei Zhuo <weizhuo[at]gmail[dot]com>
6565 * @version v1.0, last update on Fri Dec 10 18:10:20 EST 2004
6666 * @package symfony
@@ -110,11 +110,11 @@ function __construct($formatInfo = null)
110110 *
111111 * @param mixed the number to format.
112112 * @param string the format pattern, either, 'c', 'd', 'e', 'p'
113- * or a custom pattern. E.g. "#.000" will format the number to
113+ * or a custom pattern. E.g. "#.000" will format the number to
114114 * 3 decimal places.
115- * @param string 3-letter ISO 4217 code. For example, the code
115+ * @param string 3-letter ISO 4217 code. For example, the code
116116 * "USD" represents the US Dollar and "EUR" represents the Euro currency.
117- * @return string formatted number string
117+ * @return string formatted number string
118118 */
119119 function format ($ number , $ pattern = 'd ' , $ currency = 'USD ' , $ charset = null )
120120 {
@@ -123,7 +123,7 @@ function format($number, $pattern = 'd', $currency = 'USD', $charset = null)
123123 $ sfCharset = sfConfig::get ('sf_charset ' , 'UTF-8 ' );
124124 $ charset = strtolower ($ sfCharset ) == 'iso-8859-1 ' ? 'cp1250 ' : $ sfCharset ;
125125 }
126-
126+
127127 $ this ->setPattern ($ pattern );
128128
129129 if (strtolower ($ pattern ) == 'p ' )
@@ -203,7 +203,7 @@ protected function formatInteger($string)
203203 // now for the integer groupings
204204 for ($ i = 0 ; $ i < $ len ; $ i ++)
205205 {
206- $ char = $ string{ $ len - $ i - 1 } ;
206+ $ char = $ string[ $ len - $ i - 1 ] ;
207207
208208 if ($ multiGroup && $ count == 0 )
209209 {
0 commit comments