if ((number & 0x02) == 0x02)
{
// ok, it's just a plain ol' int; we can handle this
- // trivially by right-shifting and casting
+ // trivially by casting
rvalue = ( double ) (raw_number);
}
else
// hall, especially if it's the city of Redmond
rvalue /= 100;
}
+
return rvalue;
}
--- /dev/null
+package org.apache.poi.hssf.util;
+
+import junit.framework.TestCase;
+
+public class TestRKUtil
+ extends TestCase
+{
+ public TestRKUtil(String s)
+ {
+ super(s);
+ }
+
+ public void testDecode()
+ throws Exception
+ {
+ assertEquals(3.0, RKUtil.decodeNumber(1074266112), 0.0000001);
+ assertEquals(3.3, RKUtil.decodeNumber(1081384961), 0.0000001);
+ assertEquals(3.33, RKUtil.decodeNumber(1081397249), 0.0000001);
+ }
+}