[ Index ]
 

Code source de PRADO 3.0.6

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/framework/I18N/ -> TNumberFormat.php (sommaire)

TNumberFromat component.

Author: Wei Zhuo
Copyright: Copyright © 2005 PradoSoft
License: http://www.pradosoft.com/license/
Version: $Id: TNumberFormat.php 1397 2006-09-07 07:55:53Z wei $
Poids: 199 lignes (6 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

TNumberFormat:: (10 méthodes):
  getPattern()
  setPattern()
  getValue()
  setValue()
  getType()
  setType()
  getCurrency()
  setCurrency()
  getFormattedValue()
  render()


Classe: TNumberFormat  - X-Ref

To format numbers in locale sensitive manner use
<code>
<com:TNumberFormat Pattern="0.##" value="2.0" />
</code>

Numbers can be formatted as currency, percentage, decimal or scientific
numbers by specifying the Type attribute. The known types are
"currency", "percentage", "decimal" and "scientific".

If someone from US want to see sales figures from a store in
Germany (say using the EURO currency), formatted using the german
currency, you would need to use the attribute Culture="de_DE" to get
the currency right, e.g. 100,00 â‚?. The decimal and grouping separator is
then also from the de_DE locale. This may lead to some confusion because
people from US know the "," as thousand separator. Therefore a "Currency"
attribute is available, so that the output from the following example
results in â‚?100.00
<code>
<com:TNumberFormat Type="currency" Culture="en_US" Currency="EUR" Value="100" />
</code>

Namespace: System.I18N

Properties
- <b>Value</b>, number,
<br>Gets or sets the number to format. The tag content is used as Value
if the Value property is not specified.
- <b>Type</b>, string,
<br>Gets or sets the formatting type. The valid types are
'decimal', 'currency', 'percentage' and 'scientific'.
- <b>Currency</b>, string,
<br>Gets or sets the currency symbol for the currency format.
The default is 'USD' if the Currency property is not specified.
- <b>Pattern</b>, string,
<br>Gets or sets the custom number formatting pattern.

getPattern()   X-Ref
Get the number formatting pattern.

return: string format pattern.

setPattern($pattern)   X-Ref
Set the number format pattern.

param: string format pattern.

getValue()   X-Ref
Get the numberic value for this control.

return: string number

setValue($value)   X-Ref
Set the numberic value for this control.

param: string the number value

getType()   X-Ref
Get the formatting type for this control.

return: string formatting type.

setType($type)   X-Ref
Set the formatting type for this control.

param: string formatting type, either "decimal", "currency","percentage"

getCurrency()   X-Ref

return: string 3 letter currency code. Defaults to 'USD'.

setCurrency($currency)   X-Ref
Set the 3-letter ISO 4217 code. For example, the code
"USD" represents the US Dollar and "EUR" represents the Euro currency.

param: string currency code.

getFormattedValue()   X-Ref
Formats the localized number, be it currency or decimal, or percentage.
If the culture is not specified, the default application
culture will be used.

return: string formatted number

render($writer)   X-Ref
Pas de description



Généré le : Sun Feb 25 21:07:04 2007 par Balluche grâce à PHPXref 0.7