2012-02-14 3 views
2
<xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml" 
    xmlns:odt="http://orbeon.org/oxf/xml/datatypes" 
    xmlns:xi="http://www.w3.org/2001/XInclude" 
    xmlns:sql="http://orbeon.org/oxf/xml/sql" 
    xmlns:xxi="http://orbeon.org/oxf/xml/xinclude" 
    xmlns:p="http://www.orbeon.com/oxf/pipeline" 
    xmlns:saxon="http://saxon.sf.net/" 
    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
    xmlns:oxf="http://www.orbeon.com/oxf/processors" 
    xmlns:xs="http://www.w3.org/2001/XMLSchema" 
    xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" 
    xmlns:exforms="http://www.exforms.org/exf/1-0" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:fr="http://orbeon.org/oxf/xml/form-runner" 
    xmlns:ev="http://www.w3.org/2001/xml-events" 
    xmlns:pipeline="java:org.orbeon.oxf.processor.pipeline.PipelineFunctionLibrary" 
    xmlns:f="http://orbeon.org/oxf/xml/formatting" 
    xmlns:xforms="http://www.w3.org/2002/xforms" 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    xmlns:exf="http://www.exforms.org/exf/1-0" 
    xmlns:date="http://exslt.org/dates-and-times"> 

    <xhtml:head> 


     <xforms:model id="model"> 


     <xforms:instance id="test"> 
      <form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 
       <add> 
        <value></value> 
        <result></result> 
       </add> 
      </form> 
     </xforms:instance> 



       <xforms:bind id="value" nodeset="instance('test')/add/value" /> 
       <xforms:bind id="result" nodeset="instance('test')/add/result" calculate="number(../value) * 2" /> 

     </xforms:model> 
    </xhtml:head> 

    <xhtml:body> 
     <table> 

      <tr> 
       <td>Value</td> 
       <td> 
        <fr:currency bind="value" incremental="true"> 
        </fr:currency> 
       </td> 
       <td>* 2 =</td> 
       <td></td><td></td> 
       <td></td> 
       <td> 
        <fr:currency bind="result" incremental="true"> 
        </fr:currency> 
       </td> 
      </tr> 

     </table> 
    </xhtml:body> 
</xhtml:html> 

上記のプログラムでは、2番目のテキストボックスは値* 2を掛けて計算されます。 Valueテキストボックスに345の値が指定されている場合、次のテキストボックスに690が表示されます。しかし、3453456という値が与えられると、値は6.90になります。私はこれが倍精度値のためであることを知っています。私はこれが起こることを望んでいないし、実際の価値を表示したい。これをどのように実行できますか?倍精度の変更フォーマットを停止することはできますか? <fr:currency>フィールドにありますか?

答えて

0

要素にXSLTスタイルシートを使用して、値にformat-numberメソッドを適用します。 Number式全体の強制はまた働くかもしれません:

関連する問題