How can I convert scientific notation to decimal in ColdFusion?

五迷三道 提交于 2019-12-24 01:27:22

问题


I have a number that is represented in scientific notation as 1E-05. I would like to display this value, via ColdFusion, as 0.00001. How do I do that?


回答1:


Also worth noting: you can pass any valid number to PrecisionEvaluate().
So, if you have a mix of scientific notation and regular numbers, you are safe to just wrap them all in PrecisionEvaluate().

Examples:

PrecisionEvaluate('1E-05') // 0.00001  
PrecisionEvaluate('1E-06') // 0.000001  
PrecisionEvaluate('10') // 10  
PrecisionEvaluate('11.35000') // 11.35000

ColdFusion 10 docs (http://help.adobe.com/en_US/ColdFusion/10.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7fd9.html)




回答2:


Use PrecisionEvaluate('1E-05')



来源:https://stackoverflow.com/questions/16967592/how-can-i-convert-scientific-notation-to-decimal-in-coldfusion

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