{ "type": "class", | |
"qname": "mx.formatters.NumberFormatter", | |
"baseClassname": "mx.formatters.Formatter" | |
, | |
"description": "The NumberFormatter class formats a valid number by adjusting the decimal rounding and precision, the thousands separator, and the negative sign. <p>If you use both the <code>rounding</code> and <code>precision</code> properties, rounding is applied first, and then you set the decimal length by using the specified <code>precision</code> value. This lets you round a number and still have a trailing decimal; for example, 303.99 = 304.00.</p> <p>If an error occurs, an empty String is returned and a String describing the error is saved to the <code>error</code> property. The <code>error</code> property can have one of the following values:</p> <ul> <li><code>"Invalid value"</code> means an invalid numeric value is passed to the <code>format()</code> method. The value should be a valid number in the form of a Number or a String.</li> <li><code>"Invalid format"</code> means one of the parameters contain an unusable setting.</li> </ul> <p>The <code><mx:NumberFormatter></code> tag inherits all of the tag attributes of its superclass, and adds the following tag attributes:</p> <pre>\\n <mx:NumberFormatter\\n decimalSeparatorFrom="."\\n decimalSeparatorTo="."\\n precision="-1"\\n rounding="none|up|down|nearest"\\n thousandsSeparatorFrom=","\\n thousandsSeparatorTo=","\\n useNegativeSign="true|false"\\n useThousandsSeparator="true|false"/>\\n </pre>", | |
"tags": [ | |
{ "tagName": "includeExample", | |
"values": ["examples/NumberFormatterExample.mxml"]}, | |
{ "tagName": "see", | |
"values": ["mx.formatters.NumberBase", "mx.formatters.NumberBaseRoundType"]}, | |
{ "tagName": "playerversion", | |
"values": ["Flash 9", "AIR 1.1"]}, | |
{ "tagName": "mxml", | |
"values": []}, | |
{ "tagName": "productversion", | |
"values": ["Royale 0.9.3"]}, | |
{ "tagName": "langversion", | |
"values": ["3.0"]} ], | |
"members": [ | |
{ "type": "method", | |
"qname": "mx.formatters.NumberFormatter", | |
"namespace": "", | |
"bindable": [], | |
"details": [], | |
"deprecated": {}, | |
"description": "Constructor.", | |
"tags": [ | |
{ "tagName": "playerversion", | |
"values": ["Flash 9", "AIR 1.1"]}, | |
{ "tagName": "productversion", | |
"values": ["Royale 0.9.3"]}, | |
{ "tagName": "langversion", | |
"values": ["3.0"]} ], | |
"return": "", | |
"params": []} | |
, | |
{ "type": "accessor", | |
"access": "read-write", | |
"return": "String", | |
"qname": "decimalSeparatorFrom", | |
"namespace": "public", | |
"bindable": [], | |
"details": [], | |
"deprecated": {}, | |
"description": "Decimal separator character to use when parsing an input String. <p>When setting this property, ensure that the value of the <code>thousandsSeparatorFrom</code> property does not equal this property. Otherwise, an error occurs when formatting the value.</p>", | |
"tags": [ | |
{ "tagName": "default", | |
"values": ["".""]}, | |
{ "tagName": "see", | |
"values": ["#format()"]}, | |
{ "tagName": "playerversion", | |
"values": ["Flash 9", "AIR 1.1"]}, | |
{ "tagName": "productversion", | |
"values": ["Royale 0.9.3"]}, | |
{ "tagName": "langversion", | |
"values": ["3.0"]} ]}, | |
{ "type": "accessor", | |
"access": "read-write", | |
"return": "String", | |
"qname": "decimalSeparatorTo", | |
"namespace": "public", | |
"bindable": [], | |
"details": [], | |
"deprecated": {}, | |
"description": "Decimal separator character to use when outputting formatted decimal numbers. <p>When setting this property, ensure that the value of the <code>thousandsSeparatorTo</code> property does not equal this property. Otherwise, an error occurs when formatting the value.</p>", | |
"tags": [ | |
{ "tagName": "default", | |
"values": ["".""]}, | |
{ "tagName": "see", | |
"values": ["#format()"]}, | |
{ "tagName": "playerversion", | |
"values": ["Flash 9", "AIR 1.1"]}, | |
{ "tagName": "productversion", | |
"values": ["Royale 0.9.3"]}, | |
{ "tagName": "langversion", | |
"values": ["3.0"]} ]}, | |
{ "type": "accessor", | |
"access": "read-write", | |
"return": "Object", | |
"qname": "precision", | |
"namespace": "public", | |
"bindable": [], | |
"details": [], | |
"deprecated": {}, | |
"description": "Number of decimal places to include in the output String. You can disable precision by setting it to <code>-1</code>. A value of <code>-1</code> means do not change the precision. For example, if the input value is 1.453 and <code>rounding</code> is set to <code>NumberBaseRoundType.NONE</code>, return a value of 1.453. If <code>precision</code> is <code>-1</code> and you have set some form of rounding, return a value based on that rounding type.", | |
"tags": [ | |
{ "tagName": "default", | |
"values": ["-1"]}, | |
{ "tagName": "playerversion", | |
"values": ["Flash 9", "AIR 1.1"]}, | |
{ "tagName": "productversion", | |
"values": ["Royale 0.9.3"]}, | |
{ "tagName": "langversion", | |
"values": ["3.0"]} ]}, | |
{ "type": "accessor", | |
"access": "read-write", | |
"return": "String", | |
"qname": "rounding", | |
"namespace": "public", | |
"bindable": [], | |
"details": [], | |
"deprecated": {}, | |
"description": "Specifies how to round the number. <p>In ActionScript, you can use the following constants to set this property: <code>NumberBaseRoundType.NONE</code>, <code>NumberBaseRoundType.UP</code>, <code>NumberBaseRoundType.DOWN</code>, or <code>NumberBaseRoundType.NEAREST</code>. Valid MXML values are "down", "nearest", "up", and "none".</p>", | |
"tags": [ | |
{ "tagName": "default", | |
"values": ["NumberBaseRoundType.NONE"]}, | |
{ "tagName": "see", | |
"values": ["mx.formatters.NumberBaseRoundType"]}, | |
{ "tagName": "playerversion", | |
"values": ["Flash 9", "AIR 1.1"]}, | |
{ "tagName": "productversion", | |
"values": ["Royale 0.9.3"]}, | |
{ "tagName": "langversion", | |
"values": ["3.0"]} ]}, | |
{ "type": "accessor", | |
"access": "read-write", | |
"return": "String", | |
"qname": "thousandsSeparatorFrom", | |
"namespace": "public", | |
"bindable": [], | |
"details": [], | |
"deprecated": {}, | |
"description": "Character to use as the thousands separator in the input String. <p>When setting this property, ensure that the value of the <code>decimalSeparatorFrom</code> property does not equal this property. Otherwise, an error occurs when formatting the value.</p>", | |
"tags": [ | |
{ "tagName": "default", | |
"values": ["",""]}, | |
{ "tagName": "see", | |
"values": ["#format()"]}, | |
{ "tagName": "playerversion", | |
"values": ["Flash 9", "AIR 1.1"]}, | |
{ "tagName": "productversion", | |
"values": ["Royale 0.9.3"]}, | |
{ "tagName": "langversion", | |
"values": ["3.0"]} ]}, | |
{ "type": "accessor", | |
"access": "read-write", | |
"return": "String", | |
"qname": "thousandsSeparatorTo", | |
"namespace": "public", | |
"bindable": [], | |
"details": [], | |
"deprecated": {}, | |
"description": "Character to use as the thousands separator in the output String. <p>When setting this property, ensure that the value of the <code>decimalSeparatorTo</code> property does not equal this property. Otherwise, an error occurs when formatting the value.</p>", | |
"tags": [ | |
{ "tagName": "default", | |
"values": ["",""]}, | |
{ "tagName": "see", | |
"values": ["#format()"]}, | |
{ "tagName": "playerversion", | |
"values": ["Flash 9", "AIR 1.1"]}, | |
{ "tagName": "productversion", | |
"values": ["Royale 0.9.3"]}, | |
{ "tagName": "langversion", | |
"values": ["3.0"]} ]}, | |
{ "type": "accessor", | |
"access": "read-write", | |
"return": "Object", | |
"qname": "useNegativeSign", | |
"namespace": "public", | |
"bindable": [], | |
"details": [], | |
"deprecated": {}, | |
"description": "If <code>true</code>, format a negative number by preceding it with a minus "-" sign. If <code>false</code>, format the number surrounded by parentheses, for example (400).", | |
"tags": [ | |
{ "tagName": "default", | |
"values": ["true"]}, | |
{ "tagName": "playerversion", | |
"values": ["Flash 9", "AIR 1.1"]}, | |
{ "tagName": "productversion", | |
"values": ["Royale 0.9.3"]}, | |
{ "tagName": "langversion", | |
"values": ["3.0"]} ]}, | |
{ "type": "accessor", | |
"access": "read-write", | |
"return": "Object", | |
"qname": "useThousandsSeparator", | |
"namespace": "public", | |
"bindable": [], | |
"details": [], | |
"deprecated": {}, | |
"description": "If <code>true</code>, split the number into thousands increments by using a separator character.", | |
"tags": [ | |
{ "tagName": "default", | |
"values": ["true"]}, | |
{ "tagName": "playerversion", | |
"values": ["Flash 9", "AIR 1.1"]}, | |
{ "tagName": "productversion", | |
"values": ["Royale 0.9.3"]}, | |
{ "tagName": "langversion", | |
"values": ["3.0"]} ]}, | |
{ "type": "method", | |
"qname": "format", | |
"namespace": "public", | |
"bindable": [], | |
"details": ["override"], | |
"deprecated": {}, | |
"description": "Formats the number as a String. If <code>value</code> cannot be formatted, return an empty String and write a description of the error to the <code>error</code> property.", | |
"tags": [ | |
{ "tagName": "param", | |
"values": ["value Value to format."]}, | |
{ "tagName": "playerversion", | |
"values": ["Flash 9", "AIR 1.1"]}, | |
{ "tagName": "productversion", | |
"values": ["Royale 0.9.3"]}, | |
{ "tagName": "return", | |
"values": ["Formatted String. Empty if an error occurs."]}, | |
{ "tagName": "langversion", | |
"values": ["3.0"]} ], | |
"return": "String", | |
"params": [{ "name": "value", "type": "Object"}]} | |
] | |
} |