I have this string:
$V{Formatter}.format(new Double($F{quantita}.replaceAll(",",".")))+" " + $F{unitaDiMisura}
that serves to display a number on a document, based on the value that the user digits on his control panel.
With this string, if the user digits "1", in the document appears "1,00".
What do I need to do if I don't want the decimals to be displayed? Example: if the user digits "1", I want that in the document is displayed "1".
Sorry if something is not understandable, I'm not a developer...
Thanks in advance to everyone who will help.
You have to convert the double value to integer type.
I assume $F{quantita} contains the double value (in String) then,
String.valueOf(Double.valueOf($F{quantita}).intValue())
Above line can be split down like below.
Double value = Double.valueOf($F{quantita});
Integer intValue = value.intValue();
intValue.toString();