/* return decimal */
private static long hexToDec(String hex) {
int places = hex.length();
if(places > 10) {
throw new SSErrorXelException(SSError.NUM);
} else {
if(!isHex(hex)) {
throw new SSErrorXelException(SSError.NUM);
}
Long result = Long.valueOf(hex, 16);
if(result.longValue() > Long.valueOf("7fffffffff", 16).longValue()) {
result = Long.valueOf(result.longValue()-Long.valueOf("10000000000", 16).longValue());
}