It must be June 13th, the Zombies are running around, feasting, and just in general messing everything up with their smelly drippy bodies. I swear they have invaded and found a nice pleasant home in Java's DecimalFormat class. Particularly the format method. Now maybe I'm doing something completely wrong here, or maybe I'm expecting too much. However, I would expect the following simple test to pass:

Note: My interpretation of DecimalFormat assumed that if there was a Zero exponential value that it would not be displayed, otherwise it would. Thanks to the zombie squishers that corrected my interpretation.



public void testFloatFormat() throws Exception {
Float value = 1.0f; // Double's have the same issue
DecimalFormat format = new DecimalFormat("0.#######E0");
String result = format.format(value);
assertEquals("1", result);
}


But NOOOOOOOOOOOOOOO....what do I get in the result variable instead? "1E0". The freaking "1E0" zombie has been causing me all sorts of nightmares with the PsychoPath XPath 2.0 processor. I finally hacked around the issue, but I would like to know if it is indeed a zombie infestation, or if there is some Bruce Campbell Chainsaw Welding Army of Darkness Voodoo (see picture at the top) that I need to do to get this to work. I'd even take a simple explanation as to why I'm getting these results. The Java Vodoo Machine (JVM) that is being used is Sun's 1.6.13.

Oh well...with the hacks I put in place...an additional 165 tests are now passing for PsychoPath. One step closer to full compliance.

Zombies...I hate them.

Note: The long term solution is to use my own Chainsaw approach, and create a custom XPathDecimalFormat that extends DecimalFormat to combat what I consider to be zombies.