I am transforming a Json document that contains a number field with a value of 30000000.00.
I am transforming within Java using the following spec (I have truncated after the relevant lines):
StringBuilder jsltSpec = new StringBuilder();
jsltSpec.append("import \"http://jslt.schibsted.com/2018/experimental\" as exp ");
jsltSpec.append("def timeVal(obj) " +
"if ($obj) " +
"if (size($obj) == 5) " +
"format-time(parse-time(join($obj, \"-\"), \"yyyy-M-d-HH-mm\"), \"yyyy-MM-dd'T'HH:mm:ss.SSSX\") " +
"else " +
"format-time(parse-time(join($obj, \"-\"), \"yyyy-M-d-HH-mm-ss\"), \"yyyy-MM-dd'T'HH:mm:ss.SSSX\") " +
"else " +
"null ");
jsltSpec.append("def dateVal(obj) " +
"if ($obj) " +
"format-time(parse-time(join($obj, \"-\"), \"yyyy-M-d\"), \"yyyy-MM-dd'T'HH:mm:ss.SSSX\") " +
"else " +
"null ");
jsltSpec.append("let nestedTran = " +
"[ " +
"for (.responseBody.eelaccountsList) " +
"let sa = " +
"{ " +
"\"Transactions\" : " +
"[ " +
"for (.transactions) " +
"let st = " +
"{ " +
"\"@type\" : .\"@type\"," +
"\"accountId\" : .accountId, " +
"\"amount\" : .amount, " +
"\"category\" : .category, " +
The amount field that is produced is 3.0E7 which is not acceptable to the downstream consumer.
Does anyone know if there is a formatting function available that can be used to suppress the exponential notation?
Thanks,
David