0
Set the Pattern attribute to the textField tag:
<textField pattern="###0.00">
<reportElement x="437" y="462" width="100" height="20"/>
<textElement/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{fieldFloat}]]></textFieldExpression>
</textField>
If you are using an IDE, such as iReport, in the object properties you will get this attribute pattern
with several options.
I am using the IDE yes, but I put this where? In XML?
– Victorprvt
If you can look at my picture I posted, 'cause I don’t know where to put it...
– Victorprvt
Oops, I’ve been away. In your image you’re highlighting the
<staticText>
which is (probably) the column name in the caseValor Parcela
. You should put the Pattern ontextField
, which is the field that will actually receive the value of the plot (e.g. 50.00).– mari
Since you are using iReport, in the Design tab (in the image it is in the XML), click on the field that will show the value, the properties table should appear on the right side, then just look for the Pattern property. Clicking opens a window that even has several format suggestions. I hope you’ve already found the answer, in which case, post here to help other people.
– mari