Skip to content

Commit

Permalink
$string(double) chooses exponent notation for small numbers #44
Browse files Browse the repository at this point in the history
  • Loading branch information
aeberhart committed Jun 14, 2024
1 parent e9124f8 commit 2a1c7ef
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/test/java/com/dashjoin/jsonata/StringTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ public class StringTest {
@Test
public void stringTest() {
Assertions.assertEquals("abc", jsonata("$string($)").evaluate("abc"));
Assertions.assertEquals("100", jsonata("$string(100.0)").evaluate(null));
}

@Disabled
@Test
public void stringExponentTest() {
Assertions.assertEquals("100", jsonata("$string(x)").evaluate(Map.of("x", 100.0)));
Assertions.assertEquals("100000000000000000000", jsonata("$string(x)").evaluate(Map.of("x", 100000000000000000000.0)));
Assertions.assertEquals("1e+21", jsonata("$string(x)").evaluate(Map.of("x", 1000000000000000000000.0)));
}

@Test
Expand Down

0 comments on commit 2a1c7ef

Please sign in to comment.