symfony API

sfNumberFormat Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

1.0 API OpenSearch

Packages

You are currently browsing the symfony API for the 1.0 version. Switch to:
This version of symfony is not maintained anymore.
If some of your projects still use this version, consider upgrading as soon as possible.

sfNumberFormat class.

Method Summary

  • fixFloat()
  • string format(, , )
    Formats the number for a certain pattern. The valid patterns are
  • string formatDecimal()
    Formats the decimal places.
  • string formatInteger()
    Formats the integer, perform groupings and string padding.
  • string setPattern()
    Sets the pattern to format against. The default patterns
  • sfNumberFormat __construct()
    Creates a new number format instance. The constructor can be instantiated

Method Details

  • fixFloat () Browse code

  • (string) format (, , ) Browse code

    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 () Browse code

    Formats the decimal places.

    returns formatted decimal places.

  • (string) formatInteger () Browse code

    Formats the integer, perform groupings and string padding.

    returns formatted integer string with grouping

  • (string) setPattern () Browse code

    Sets the pattern to format against. The default patterns

    are retrieved from the sfNumberFormatInfo instance.

    returns a number format pattern.

  • (sfNumberFormat) __construct () Browse code

    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.