| Refresh | Home EGTry.com

format fraction number


NumberFormatter precision=2 nearest rouding

original formatted
3.14159 3.14
100 100.00

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
	<mx:NumberFormatter id="numFormatter" rounding="nearest" precision="2" />
	<mx:Label x="90" y="82" text="{numFormatter.format(3.14159)}"/>
	<mx:TextInput x="170" y="78" text="{numFormatter.format(100)}"/>
	
</mx:Application>