converting Big Decimal(15,12) to string

人走茶凉 提交于 2019-12-11 14:06:30

问题


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?


回答1:


If you're not applying any transformations to your BigDecimal column, you can just read it as a String from your file.
If you must read it as a BigDecimal and then format it to string, you can do this in your tMap:

new DecimalFormat("#0.000000000000").format(columnName)


来源:https://stackoverflow.com/questions/48692263/converting-big-decimal15-12-to-string

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!