check for BigInteger #61

This commit is contained in:
Enrique Zamudio
2015-11-20 00:59:47 -06:00
parent e3906fd4bc
commit 95a09942ff
@@ -21,6 +21,7 @@ package com.solab.iso8583;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Date; import java.util.Date;
import java.util.TimeZone; import java.util.TimeZone;
@@ -203,6 +204,8 @@ public class IsoValue<T> implements Cloneable {
} else { } else {
return type.format(value.toString(), 12); return type.format(value.toString(), 12);
} }
} else if (value instanceof BigInteger) {
return type.format(encoder == null ? value.toString() : encoder.encodeField(value), length);
} else if (value instanceof Number) { } else if (value instanceof Number) {
return type.format(((Number)value).longValue(), length); return type.format(((Number)value).longValue(), length);
} else { } else {