套件 | mx.formatters |
類別 | public class NumberBase |
繼承 | NumberBase Object |
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
相關 API 元素
屬性 | 定義自 | ||
---|---|---|---|
constructor : Object
類別物件的參照或是特定物件實體的建構函數。 | 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 |
方法 | 定義自 | ||
---|---|---|---|
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 | ||
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 | ||
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 | ||
指出物件是否有已定義的指定屬性。 | Object | ||
指出 Object 類別的實體是否位於指定為參數的物件原型鏈中。 | Object | ||
Extracts a number from a formatted String. | NumberBase | ||
指出指定的屬性是否存在,以及是否可列舉。 | Object | ||
為迴圈作業設定動態屬性的可用性。 | Object | ||
傳回代表此物件的字串,根據地區特定慣例進行格式化。 | Object | ||
會傳回指定之物件的字串形式。 | Object | ||
會傳回指定之物件的基本值。 | Object |
decimalSeparatorFrom | 屬性 |
public var decimalSeparatorFrom:String
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
Decimal separator character to use when parsing an input String.
預設值為 "."。
decimalSeparatorTo | 屬性 |
public var decimalSeparatorTo:String
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
Decimal separator character to use when outputting formatted decimal numbers.
預設值為 "."。
isValid | 屬性 |
public var isValid:Boolean = false
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
If true
, the format succeeded,
otherwise it is false
.
thousandsSeparatorFrom | 屬性 |
public var thousandsSeparatorFrom:String
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
Character to use as the thousands separator in the input String.
預設值為 ","。
thousandsSeparatorTo | 屬性 |
public var thousandsSeparatorTo:String
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
Character to use as the thousands separator in the output String.
預設值為 ","。
NumberBase | () | 建構函式 |
public function NumberBase(decimalSeparatorFrom:String = ".", thousandsSeparatorFrom:String = ",", decimalSeparatorTo:String = ".", thousandsSeparatorTo:String = ",")
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
Constructor.
參數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.
|
expandExponents | () | 方法 |
formatDecimal | () | 方法 |
public function formatDecimal(value:String):String
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
Formats a number by replacing the default decimal separator, ".",
with the decimal separator specified by decimalSeparatorTo
.
參數
value:String — The String value of the Number
(formatted American style ####.##).
|
String — String representation of the input where "." is replaced
with the decimal formatting character.
|
formatNegative | () | 方法 |
public function formatNegative(value:String, useSign:Boolean):String
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
Formats a negative number with either a minus sign (-) or parentheses ().
參數
value:String — Value to be formatted.
| |
useSign:Boolean — If true , use a minus sign (-).
If false , use parentheses ().
|
String — Formatted number.
|
formatPrecision | () | 方法 |
public function formatPrecision(value:String, precision:int):String
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
Formats a number by setting its decimal precision by using
the decimalSeparatorTo
property as the decimal separator.
參數
value:String — Value to be formatted.
| |
precision:int — Number of decimal points to use.
|
String — Formatted number.
|
formatRounding | () | 方法 |
public function formatRounding(value:String, roundType:String):String
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
Formats a number by rounding it. The possible rounding types are defined by mx.formatters.NumberBaseRoundType.
參數
value:String — Value to be rounded.
| |
roundType:String — The type of rounding to perform:
NumberBaseRoundType.NONE, NumberBaseRoundType.UP,
NumberBaseRoundType.DOWN, or NumberBaseRoundType.NEAREST.
|
String — Formatted number.
|
相關 API 元素
formatRoundingWithPrecision | () | 方法 |
public function formatRoundingWithPrecision(value:String, roundType:String, precision:int):String
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | 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.
參數
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.
|
String — Formatted number.
|
相關 API 元素
formatThousands | () | 方法 |
public function formatThousands(value:String):String
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | 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.
參數
value:String — Value to be formatted.
|
String — Formatted number.
|
parseNumberString | () | 方法 |
public function parseNumberString(str:String):String
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | 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.
參數
str:String — String to parse for the numeric value.
|
String — Value, which can be a decimal.
|
Tue Jun 12 2018, 03:47 PM Z