Ajenjo Posted March 27, 2008 Share Posted March 27, 2008 Hi. I have two variables to sum two fields in FLOAT. Code:(...)<variable name="precio_total" class="java.lang.Float" resetType="Group" resetGroup="AlbaranGrupo" calculation="Sum"> <variableExpression><![CDATA[$F{precio}]]></variableExpression> <initialValueExpression><![CDATA[new java.lang.Float(0)]]></initialValueExpression> </variable> <variable name="importe_total" class="java.lang.Float" resetType="Group" resetGroup="AlbaranGrupo" calculation="Sum"> <variableExpression><![CDATA[$F{importe}]]></variableExpression> <initialValueExpression><![CDATA[new java.lang.Float(0)]]></initialValueExpression> </variable>(...) And I want to put these numbers with two decimals. Example .- 12.60, 34,35, 4,00... What's the way? And how can I do this.- Code:[code]<variable name="precio_total" class="java.lang.Float" calculation="Sum"> <variableExpression><![CDATA[($F{precio}.floatValue() * $F{cantidad}.floatValue())]]></variableExpression> <initialValueExpression><![CDATA[new java.lang.Float(0)]]></initialValueExpression> </variable> That's, other operations with fields available. ThanksPost edited by: Ajenjo, at: 2008/03/27 09:59 Link to comment Share on other sites More sharing options...
Ajenjo Posted March 27, 2008 Author Share Posted March 27, 2008 Post edited by: Ajenjo, at: 2008/03/27 08:45 Link to comment Share on other sites More sharing options...
Ajenjo Posted March 27, 2008 Author Share Posted March 27, 2008 Post edited by: Ajenjo, at: 2008/03/27 08:44 Link to comment Share on other sites More sharing options...
Ajenjo Posted March 27, 2008 Author Share Posted March 27, 2008 Post edited by: Ajenjo, at: 2008/03/27 08:36 Link to comment Share on other sites More sharing options...
Ajenjo Posted March 27, 2008 Author Share Posted March 27, 2008 Post edited by: Ajenjo, at: 2008/03/27 08:44 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now