Referencia de ActionScript® 3.0 para la plataforma de Adobe® Flash®
Inicio  |  Ocultar lista de paquetes y clases |  Paquetes  |  Clases  |  Novedades  |  Índice  |  Apéndices  |  ¿Por qué hay texto en inglés?
Filtros: Recuperando datos del servidor...
Recuperando datos del servidor...
mx.formatters 

NumberBase  - AS3 Flex

Paquetemx.formatters
Clasepublic class NumberBase
HerenciaNumberBase Inheritance Object

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

The NumberBase class is a utility class that contains general number formatting capabilities, including rounding, precision, thousands formatting, and negative sign formatting. The implementation of the formatter classes use this class.

Elementos de API relacionados



Propiedades públicas
 PropiedadDefinido por
 Inheritedconstructor : Object
Una referencia a la clase de objeto o función constructora para una instancia de objeto determinada.
Object
  decimalSeparatorFrom : String
Decimal separator character to use when parsing an input String.
NumberBase
  decimalSeparatorTo : String
Decimal separator character to use when outputting formatted decimal numbers.
NumberBase
  isValid : Boolean = false
If true, the format succeeded, otherwise it is false.
NumberBase
  thousandsSeparatorFrom : String
Character to use as the thousands separator in the input String.
NumberBase
  thousandsSeparatorTo : String
Character to use as the thousands separator in the output String.
NumberBase
Métodos públicos
 MétodoDefinido por
  
NumberBase(decimalSeparatorFrom:String = ".", thousandsSeparatorFrom:String = ",", decimalSeparatorTo:String = ".", thousandsSeparatorTo:String = ",")
Constructor.
NumberBase
  
Formats a number in exponent notation, into a number in decimal notation.
NumberBase
  
Formats a number by replacing the default decimal separator, ".", with the decimal separator specified by decimalSeparatorTo.
NumberBase
  
Formats a negative number with either a minus sign (-) or parentheses ().
NumberBase
  
formatPrecision(value:String, precision:int):String
Formats a number by setting its decimal precision by using the decimalSeparatorTo property as the decimal separator.
NumberBase
  
Formats a number by rounding it.
NumberBase
  
formatRoundingWithPrecision(value:String, roundType:String, precision:int):String
Formats a number by rounding it and setting the decimal precision.
NumberBase
  
Formats a number by using the thousandsSeparatorTo property as the thousands separator and the decimalSeparatorTo property as the decimal separator.
NumberBase
 Inherited
Indica si un objeto tiene definida una propiedad especificada.
Object
 Inherited
Indica si hay una instancia de la clase Object en la cadena de prototipo del objeto especificado como parámetro.
Object
  
Extracts a number from a formatted String.
NumberBase
 Inherited
Indica si existe la propiedad especificada y si es enumerable.
Object
 Inherited
Establece la disponibilidad de una propiedad dinámica para operaciones de bucle.
Object
 Inherited
Devuelve la representación de cadena de este objeto, con formato según las convenciones específicas de configuración regional.
Object
 Inherited
Devuelve la representación de cadena del objeto especificado.
Object
 Inherited
Devuelve el valor simple del objeto especificado.
Object
Información sobre propiedades

decimalSeparatorFrom

propiedad
public var decimalSeparatorFrom:String

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Decimal separator character to use when parsing an input String.

El valor predeterminado es ".".

decimalSeparatorTo

propiedad 
public var decimalSeparatorTo:String

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Decimal separator character to use when outputting formatted decimal numbers.

El valor predeterminado es ".".

isValid

propiedad 
public var isValid:Boolean = false

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

If true, the format succeeded, otherwise it is false.

thousandsSeparatorFrom

propiedad 
public var thousandsSeparatorFrom:String

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Character to use as the thousands separator in the input String.

El valor predeterminado es ",".

thousandsSeparatorTo

propiedad 
public var thousandsSeparatorTo:String

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Character to use as the thousands separator in the output String.

El valor predeterminado es ",".

Información sobre constructores

NumberBase

()Información sobre
public function NumberBase(decimalSeparatorFrom:String = ".", thousandsSeparatorFrom:String = ",", decimalSeparatorTo:String = ".", thousandsSeparatorTo:String = ",")

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Constructor.

Parámetros
decimalSeparatorFrom:String (default = ".") — Decimal separator to use when parsing an input String.
 
thousandsSeparatorFrom:String (default = ",") — Character to use as the thousands separator in the input String.
 
decimalSeparatorTo:String (default = ".") — Decimal separator character to use when outputting formatted decimal numbers.
 
thousandsSeparatorTo:String (default = ",") — Character to use as the thousands separator in the output String.
Información sobre métodos

expandExponents

()método
public function expandExponents(value:String):String

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Formats a number in exponent notation, into a number in decimal notation.

Parámetros

value:String — String to process in exponent notation.

Valor devuelto
String — Formatted number.

formatDecimal

()método 
public function formatDecimal(value:String):String

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Formats a number by replacing the default decimal separator, ".", with the decimal separator specified by decimalSeparatorTo.

Parámetros

value:String — The String value of the Number (formatted American style ####.##).

Valor devuelto
String — String representation of the input where "." is replaced with the decimal formatting character.

formatNegative

()método 
public function formatNegative(value:String, useSign:Boolean):String

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Formats a negative number with either a minus sign (-) or parentheses ().

Parámetros

value:String — Value to be formatted.
 
useSign:Boolean — If true, use a minus sign (-). If false, use parentheses ().

Valor devuelto
String — Formatted number.

formatPrecision

()método 
public function formatPrecision(value:String, precision:int):String

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Formats a number by setting its decimal precision by using the decimalSeparatorTo property as the decimal separator.

Parámetros

value:String — Value to be formatted.
 
precision:int — Number of decimal points to use.

Valor devuelto
String — Formatted number.

formatRounding

()método 
public function formatRounding(value:String, roundType:String):String

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Formats a number by rounding it. The possible rounding types are defined by mx.formatters.NumberBaseRoundType.

Parámetros

value:String — Value to be rounded.
 
roundType:String — The type of rounding to perform: NumberBaseRoundType.NONE, NumberBaseRoundType.UP, NumberBaseRoundType.DOWN, or NumberBaseRoundType.NEAREST.

Valor devuelto
String — Formatted number.

Elementos de API relacionados

formatRoundingWithPrecision

()método 
public function formatRoundingWithPrecision(value:String, roundType:String, precision:int):String

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Formats a number by rounding it and setting the decimal precision. The possible rounding types are defined by mx.formatters.NumberBaseRoundType.

Parámetros

value:String — Value to be rounded.
 
roundType:String — The type of rounding to perform: NumberBaseRoundType.NONE, NumberBaseRoundType.UP, NumberBaseRoundType.DOWN, or NumberBaseRoundType.NEAREST.
 
precision:int — int of decimal places to use.

Valor devuelto
String — Formatted number.

Elementos de API relacionados

formatThousands

()método 
public function formatThousands(value:String):String

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Formats a number by using the thousandsSeparatorTo property as the thousands separator and the decimalSeparatorTo property as the decimal separator.

Parámetros

value:String — Value to be formatted.

Valor devuelto
String — Formatted number.

parseNumberString

()método 
public function parseNumberString(str:String):String

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Extracts a number from a formatted String. Examines the String from left to right and returns the first number sequence. Ignores thousands separators and includes the decimal and numbers trailing the decimal.

Parámetros

str:String — String to parse for the numeric value.

Valor devuelto
String — Value, which can be a decimal.




[ X ]¿Por qué hay texto en inglés?
Cierto contenido de la Referencia de ActionScript 3.0 se muestra en inglés

No todo el contenido de la Referencia de ActionScript 3.0 se traduce a todos los idiomas. Si un elemento del lenguaje no se traduce, aparecerá en inglés. Por ejemplo, la clase ga.controls.HelpBox no está traducida en ningún idioma. Por lo tanto, en la versión en español de la referencia, la clase ga.controls.HelpBox aparecerá en inglés.