blob: 08ba87159d302da7f567a97d19e52ef3211d1633 [file] [log] [blame]
{ "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>&quot;Invalid value&quot;</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>&quot;Invalid format&quot;</code> means one of the parameters contain an unusable setting.</li> </ul> <p>The <code>&lt;mx:NumberFormatter&gt;</code> tag inherits all of the tag attributes of its superclass, and adds the following tag attributes:</p> <pre>\\n &lt;mx:NumberFormatter\\n decimalSeparatorFrom=&quot;.&quot;\\n decimalSeparatorTo=&quot;.&quot;\\n precision=&quot;-1&quot;\\n rounding=&quot;none|up|down|nearest&quot;\\n thousandsSeparatorFrom=&quot;,&quot;\\n thousandsSeparatorTo=&quot;,&quot;\\n useNegativeSign=&quot;true|false&quot;\\n useThousandsSeparator=&quot;true|false&quot;/>\\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 &quot;down&quot;, &quot;nearest&quot;, &quot;up&quot;, and &quot;none&quot;.</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 &quot;-&quot; 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"}]}
]
}