<commit_before><?xml version="1.0" encoding="utf-8"?>
<!-- Simple example to demonstrate the CurrencyFormatter. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">

    <mx:Script>
        <![CDATA[

              import mx.events.ValidationResultEvent;			
              private var vResult:ValidationResultEvent;
			
              // Event handler to validate and format input.
              private function Format():void {
              
                 	vResult = numVal.validate();

    				if (vResult.type==ValidationResultEvent.VALID) {
                        var temp:Number=Number(priceUS.text); 
                        formattedUSPrice.text= usdFormatter.format(temp);
                    }
                    
                    else {
                       formattedUSPrice.text="";
                    }
              }
        ]]>
    </mx:Script>

    <mx:CurrencyFormatter id="usdFormatter" precision="2" 
        currencySymbol="$" decimalSeparatorFrom="."
        decimalSeparatorTo="." useNegativeSign="true" 
        useThousandsSeparator="true" alignSymbol="left"/>

    <mx:NumberValidator id="numVal" source="{priceUS}" property="text" 
        allowNegative="true" domain="real"/>

    <mx:Panel title="CurrencyFormatter Example" width="75%" height="75%" 
        paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10">

        <mx:Form>
            <mx:FormItem label="Enter U.S. dollar amount:">
                <mx:TextInput id="priceUS" text="" width="50%"/>
            </mx:FormItem>

            <mx:FormItem label="Formatted amount: ">
                <mx:TextInput id="formattedUSPrice" text="" width="50%" editable="false"/>
            </mx:FormItem>

            <mx:FormItem>
                <mx:Button label="Validate and Format" click="Format();"/>
            </mx:FormItem>
        </mx:Form>

    </mx:Panel>
</mx:Application><commit_msg>Transferred from the Adobe Open Source Subversion Repository<commit_after><?xml version="1.0" encoding="utf-8"?>
<!-- Simple example to demonstrate the CurrencyFormatter. -->
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/halo">

    <fx:Script>
        <![CDATA[
            import mx.events.ValidationResultEvent;

            private var vResult:ValidationResultEvent;

            // Event handler to validate and format input.
            private function Format():void {
                vResult = numVal.validate();

                if (vResult.type==ValidationResultEvent.VALID) {
                    var temp:Number = Number(priceUS.text); 
                    formattedUSPrice.text = usdFormatter.format(temp);
                } else {
                    formattedUSPrice.text = "";
                }
            }
        ]]>
    </fx:Script>

    <fx:Declarations>
        <mx:CurrencyFormatter id="usdFormatter" precision="2" 
                currencySymbol="$" decimalSeparatorFrom="."
                decimalSeparatorTo="." useNegativeSign="true" 
                useThousandsSeparator="true" alignSymbol="left"/>

        <mx:NumberValidator id="numVal" source="{priceUS}" property="text" 
                allowNegative="true" domain="real"/>
    </fx:Declarations>

    <s:Panel title="CurrencyFormatter Example"
            width="75%" height="75%"
            horizontalCenter="0" verticalCenter="0">
        <mx:Form left="10" right="10" top="10" bottom="10">
            <mx:FormItem label="Enter U.S. dollar amount:">
                <s:TextInput id="priceUS" text="" width="50%"/>
            </mx:FormItem>
            <mx:FormItem label="Formatted amount: ">
                <s:TextInput id="formattedUSPrice" text="" width="50%" editable="false"/>
            </mx:FormItem>
            <mx:FormItem>
                <s:Button label="Validate and Format" click="Format();"/>
            </mx:FormItem>
        </mx:Form>
    </s:Panel>

</s:Application>
{'fraction_non_alphanumeric': 0.14075, 'fraction_numerical': 0.0125, 'mean_word_length': 2.0425855513307987, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 2, '>': 49, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 8}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6445060', 'n_tokens_mistral': 1154, 'n_tokens_neox': 1063, 'n_words': 199}