ActionScript® 3.0 — dokumentacja dla platformy Adobe® Flash®
Strona główna  |  Ukryj listę pakietów i klas |  Pakiety  |  Klasy  |  Nowości  |  Indeks  |  Dodatki  |  Dlaczego język angielski?
Filtry: Pobieranie danych z serwera...
Pobieranie danych z serwera...
mx.formatters 

NumberBase  - AS3 Flex

Pakietmx.formatters
Klasapublic class NumberBase
DziedziczenieNumberBase Inheritance Object

Wersja języka: ActionScript 3.0
Wersja produktu: Flex 3
Wersje środowiska wykonawczego: 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.

Powiązane elementy interfejsu API



Właściwości publiczne
 WłaściwośćZdefiniowane przez
 Inheritedconstructor : Object
Odwołanie do obiektu klasy lub funkcji konstruktora, dotyczące danej instancji obiektu.
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
Metody publiczne
 MetodaZdefiniowane przez
  
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
Wskazuje, czy dla obiektu zdefiniowano określoną właściwość.
Object
 Inherited
Wskazuje, czy instancja klasy Object należy do łańcucha prototypów obiektu określonego jako parametr.
Object
  
Extracts a number from a formatted String.
NumberBase
 Inherited
Wskazuje, czy określona właściwość istnieje i jest przeliczalna.
Object
 Inherited
Ustawia dostępność właściwości dynamicznej używanej w pętlach.
Object
 Inherited
Zwraca ciąg reprezentujący obiekt — sformatowany zgodnie z konwencjami właściwymi dla ustawień regionalnych.
Object
 Inherited
Zwraca ciąg reprezentujący określony obiekt.
Object
 Inherited
Zwraca pierwotną wartość dla określonego obiektu.
Object
Szczegół właściwości

decimalSeparatorFrom

właściwość
public var decimalSeparatorFrom:String

Wersja języka: ActionScript 3.0
Wersja produktu: Flex 3
Wersje środowiska wykonawczego: Flash Player 9, AIR 1.1

Decimal separator character to use when parsing an input String.

Wartością domyślną jest ".".

decimalSeparatorTo

właściwość 
public var decimalSeparatorTo:String

Wersja języka: ActionScript 3.0
Wersja produktu: Flex 3
Wersje środowiska wykonawczego: Flash Player 9, AIR 1.1

Decimal separator character to use when outputting formatted decimal numbers.

Wartością domyślną jest ".".

isValid

właściwość 
public var isValid:Boolean = false

Wersja języka: ActionScript 3.0
Wersja produktu: Flex 3
Wersje środowiska wykonawczego: Flash Player 9, AIR 1.1

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

thousandsSeparatorFrom

właściwość 
public var thousandsSeparatorFrom:String

Wersja języka: ActionScript 3.0
Wersja produktu: Flex 3
Wersje środowiska wykonawczego: Flash Player 9, AIR 1.1

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

Wartością domyślną jest ",".

thousandsSeparatorTo

właściwość 
public var thousandsSeparatorTo:String

Wersja języka: ActionScript 3.0
Wersja produktu: Flex 3
Wersje środowiska wykonawczego: Flash Player 9, AIR 1.1

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

Wartością domyślną jest ",".

Konstruktor Szczegół

NumberBase

()Konstruktor
public function NumberBase(decimalSeparatorFrom:String = ".", thousandsSeparatorFrom:String = ",", decimalSeparatorTo:String = ".", thousandsSeparatorTo:String = ",")

Wersja języka: ActionScript 3.0
Wersja produktu: Flex 3
Wersje środowiska wykonawczego: Flash Player 9, AIR 1.1

Constructor.

Parametry
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.
Szczegół metody

expandExponents

()metoda
public function expandExponents(value:String):String

Wersja języka: ActionScript 3.0
Wersja produktu: Flex 3
Wersje środowiska wykonawczego: Flash Player 9, AIR 1.1

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

Parametry

value:String — String to process in exponent notation.

Zwraca
String — Formatted number.

formatDecimal

()metoda 
public function formatDecimal(value:String):String

Wersja języka: ActionScript 3.0
Wersja produktu: Flex 3
Wersje środowiska wykonawczego: Flash Player 9, AIR 1.1

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

Parametry

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

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

formatNegative

()metoda 
public function formatNegative(value:String, useSign:Boolean):String

Wersja języka: ActionScript 3.0
Wersja produktu: Flex 3
Wersje środowiska wykonawczego: Flash Player 9, AIR 1.1

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

Parametry

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

Zwraca
String — Formatted number.

formatPrecision

()metoda 
public function formatPrecision(value:String, precision:int):String

Wersja języka: ActionScript 3.0
Wersja produktu: Flex 3
Wersje środowiska wykonawczego: Flash Player 9, AIR 1.1

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

Parametry

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

Zwraca
String — Formatted number.

formatRounding

()metoda 
public function formatRounding(value:String, roundType:String):String

Wersja języka: ActionScript 3.0
Wersja produktu: Flex 3
Wersje środowiska wykonawczego: Flash Player 9, AIR 1.1

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

Parametry

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

Zwraca
String — Formatted number.

Powiązane elementy interfejsu API

formatRoundingWithPrecision

()metoda 
public function formatRoundingWithPrecision(value:String, roundType:String, precision:int):String

Wersja języka: ActionScript 3.0
Wersja produktu: Flex 3
Wersje środowiska wykonawczego: 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.

Parametry

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.

Zwraca
String — Formatted number.

Powiązane elementy interfejsu API

formatThousands

()metoda 
public function formatThousands(value:String):String

Wersja języka: ActionScript 3.0
Wersja produktu: Flex 3
Wersje środowiska wykonawczego: 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.

Parametry

value:String — Value to be formatted.

Zwraca
String — Formatted number.

parseNumberString

()metoda 
public function parseNumberString(str:String):String

Wersja języka: ActionScript 3.0
Wersja produktu: Flex 3
Wersje środowiska wykonawczego: 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.

Parametry

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

Zwraca
String — Value, which can be a decimal.




[ X ]Dlaczego język angielski?
Treść dokumentacji języka ActionScript 3.0 wyświetlana w języku angielskim

Niektóre części dokumentacji języka ActionScript 3.0 nie są przetłumaczone na poszczególne języki. Gdy element nie jest przetłumaczony na dany język, jest wyświetlany tekst angielski. Na przykład opis klasy ga.controls.HelpBox nie jest przetłumaczony na żaden dodatkowy język. Z tego powodu polska wersja dokumentacji zawiera opis klasy ga.controls.HelpBox w języku angielskim.