We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Field codes: If field


I have a problem with “if conditions”. If I for example have:




{ IF { mergeField someNumber } > 40.2 “Greater than” “Less than” }

and someNumber returns 40.166666666666664 (a java Double where toString is called)

then the result is: Greater than

But if someNumber returns 40.1

then the result is as expected: Less than

It seems that if the two numbers being compared has the exact same number of decimals, then the comparison works otherwise it not

Best regards,



Thanks for your request. Most probably, the problem occurs because wrong culture is used and values are compared as strings. If specify culture where decimal delimiter is dot, then everything works as expected. For example see the following code:

Locale L = new Locale("en", "nz");


Document doc = new Document("C:\\Temp\\in.doc");

doc.getMailMerge().execute(new String[] { "test" }, new Object[] { 4.21 });


Hope this helps.

Best regards,