<?xml version="1.0" encoding="utf-8"?>
<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/mx" minWidth="955" minHeight="600">
<fx:Declarations>
<fx:XML id="myData" xmlns="">
<root>
<forsale>
<item name="weight" value="32.5658"/>
</forsale>
</root>
</fx:XML>
<mx:NumberFormatter id="fmtNumber" precision="2" rounding="nearest"/>
</fx:Declarations>
<s:Label text="Weight {fmtNumber.format(myData.forsale.item.@value)}千克"/>
</s:Application>
rouding 属性是舍入法