Calculated Zero is displayed as Minus Zero

Hi,
“-0” is actually calculated as “-0.30” in excel, as it’s decimal places setting is Zero, it is showing “0” in excel. If I perform getValue() operation on this cell I get “-0.3” and if I perform getStringValue() operation on this cell I get “-0”. But on the screen I want to display “0” instead of “-0”. Please let me know what can be done. I have attached a sample simulation application.

Thanks & Regards,
Kailas

Hi Kailas,

Thank you for the template file and simulation application, please try this attached fix.

Hi Johnson,

The above issue is not completely fixed. I have attached a couple of test cases along with reference template. Please read my comments in the attached Java code for information on the test case.

Can you please fix this?

Thanks!
Shashi

Note: Looking at the current behavior, I guess you are using the java DecimalFormatter to format the values which does not behave like Excel does.

Hi Shashi,

Thank you for the application, yes, it is a bug of JDK's DecimalFormat, please try this attached version.

Hi Johnson,

Thanks for the fix. We tested it and its working fine. Needless to say, you guys are fantastic when it comes to support.

Thanks again!

-Shashi