diff options
author | James Ahlborn <jtahlborn@yahoo.com> | 2018-06-03 01:54:07 +0000 |
---|---|---|
committer | James Ahlborn <jtahlborn@yahoo.com> | 2018-06-03 01:54:07 +0000 |
commit | 6d200f6948c2134f4faf4a121622aec1acbf0e3a (patch) | |
tree | 7ca87adc6c800b604dc6c67e2c9fcffcf8ea3357 /src/test/java/com/healthmarketscience/jackcess/impl | |
parent | 73bf6959ddf2638320613bf201375346b2140c51 (diff) | |
download | jackcess-6d200f6948c2134f4faf4a121622aec1acbf0e3a.tar.gz jackcess-6d200f6948c2134f4faf4a121622aec1acbf0e3a.zip |
implement floating point number formatting which matches access
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/branches/exprs@1159 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'src/test/java/com/healthmarketscience/jackcess/impl')
-rw-r--r-- | src/test/java/com/healthmarketscience/jackcess/impl/expr/ExpressionatorTest.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/test/java/com/healthmarketscience/jackcess/impl/expr/ExpressionatorTest.java b/src/test/java/com/healthmarketscience/jackcess/impl/expr/ExpressionatorTest.java index 49db5bd..2f6e738 100644 --- a/src/test/java/com/healthmarketscience/jackcess/impl/expr/ExpressionatorTest.java +++ b/src/test/java/com/healthmarketscience/jackcess/impl/expr/ExpressionatorTest.java @@ -30,6 +30,7 @@ import com.healthmarketscience.jackcess.expr.Function; import com.healthmarketscience.jackcess.expr.Identifier; import com.healthmarketscience.jackcess.expr.TemporalConfig; import com.healthmarketscience.jackcess.expr.Value; +import com.healthmarketscience.jackcess.impl.NumberFormatter; import junit.framework.TestCase; /** @@ -326,7 +327,7 @@ public class ExpressionatorTest extends TestCase public void testLiteralDefaultValue() throws Exception { - assertEquals("-28.0 blah ", eval("=CDbl(9)-37 & \" blah \"", + assertEquals("-28 blah ", eval("=CDbl(9)-37 & \" blah \"", Value.Type.STRING)); assertEquals("CDbl(9)-37 & \" blah \"", eval("CDbl(9)-37 & \" blah \"", Value.Type.STRING)); @@ -385,12 +386,12 @@ public class ExpressionatorTest extends TestCase } static int roundToLongInt(double d) { - return new BigDecimal(d).setScale(0, BuiltinOperators.ROUND_MODE) + return new BigDecimal(d).setScale(0, NumberFormatter.ROUND_MODE) .intValueExact(); } static BigDecimal toBD(double d) { - return toBD(new BigDecimal("" + d)); + return toBD(BigDecimal.valueOf(d)); } static BigDecimal toBD(BigDecimal bd) { |