1

Hi i'am having a input Big Decimal(15,12) value in source in output i am expecting that as string. For example, my source file with value 0.000000000000 by using tmap to convert it into string.

  "String.valueOf(column name)" 

for this im getting output is 0E-12. expected output is 0.0000000000 can anyone provide the solution?

user8182285
  • 31
  • 1
  • 3
  • You need to format the output from BigDecimal, e.g. here: https://stackoverflow.com/questions/10269045/format-a-bigdecimal-as-string-with-max-2-decimal-digits-removing-0-on-decimal-p – tobi6 Feb 09 '18 at 09:31
  • Please see my answer to this very same question here : https://stackoverflow.com/a/48725117/899863 – Ibrahim Mezouar Feb 10 '18 at 20:14

1 Answers1

0

may be this will help

new BigDecimal("String value").setScale(12, RoundingMode.HALF_DOWN).toPlainString();

Albin
  • 1,929
  • 2
  • 14
  • 18