问题
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