将Big Decimal(15,12)转换为字符串 [英] converting Big Decimal(15,12) to string
问题描述
我在输出的源中有一个输入Big Decimal(15,12)值,我希望将其作为字符串.例如,使用tmap将其值0.000000000000的源文件转换为字符串.此即时输出的"String.valueOf(列名称)"为0E-12.预期输出为0.0000000000谁能提供解决方案?
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?
推荐答案
如果您不对BigDecimal
列进行任何转换,则可以从文件中将其作为String
读取.
如果必须将其读取为BigDecimal
,然后将其格式化为字符串,则可以在tMap
中进行此操作:
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)
这篇关于将Big Decimal(15,12)转换为字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!