Method Summary
-
fixFloat()
-
string
format($number, $pattern, $currency, $charset)
Formats the number for a certain pattern. The valid patterns are
-
string
formatDecimal($decimal)
Formats the decimal places.
-
string
formatInteger($string)
Formats the integer, perform groupings and string padding.
-
string
setPattern($pattern)
Sets the pattern to format against. The default patterns
-
sfNumberFormat
__construct($formatInfo)
Creates a new number format instance. The constructor can be instantiated
Method Details
-
-
(string) format ($number, $pattern, $currency, $charset)
Browse code
| $number |
the number to format. |
| $pattern |
the format pattern, either, 'c', 'd', 'e', 'p' or a custom pattern. E.g. "#.000" will format the number to 3 decimal places. |
| $currency |
3-letter ISO 4217 code. For example, the code "USD" represents the US Dollar and "EUR" represents the Euro currency. |
| $charset |
The charset |
Formats the number for a certain pattern. The valid patterns are
'c', 'd', 'e', 'p' or a custom pattern, such as "#.000" for
3 decimal places.
returns formatted number string
-
(string) formatDecimal ($decimal)
Browse code
| $decimal |
the decimal number in string form. |
Formats the decimal places.
returns formatted decimal places.
-
(string) formatInteger ($string)
Browse code
| $string |
the decimal number in string form. |
Formats the integer, perform groupings and string padding.
returns formatted integer string with grouping
-
(string) setPattern ($pattern)
Browse code
| $pattern |
the requested patterns. |
Sets the pattern to format against. The default patterns
are retrieved from the sfNumberFormatInfo instance.
returns a number format pattern.
-
(sfNumberFormat) __construct ($formatInfo)
Browse code
| $formatInfo |
either null, a sfCultureInfo, a sfNumberFormatInfo, or string |
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.
|