<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.Если в текстовом поле Значение указано значение 345, в следующем текстовом поле оно будет равно 690.Но когда предоставляется значение 3453456, оно дает значение 6,90.Я знаю, что это из-за значения двойной точности.но я не хочу, чтобы это произошло, и хочу, чтобы отображалось реальное значение.Как я могу выполнить это?
Используйте таблицу стилей XSLT для элемента, чтобы применить метод format-number к значению. Number Приведение всего выражения также может работать:
Number
Number(Number(../value) * 2)