How to convert a floating point value in exponential form to dot notation? [duplicate]
Possible Duplicate:
Prevent scientific notation in ostream when using << with double
I get 1e-1 as result after a computation how can I convert the result from exponent to dot notation i.e., 0.1 ? Why is it automatically converted to exponential notation!!
You can use the fixed
I/O manipulator to force the number to be printed in fixed-point notation:
double d = 42.0;
std::cout << std::fixed << d;
(std::scientific
does the opposite: it forces the number to be printed in scientific notation)
Oracle (generally) doesn't do binary numbers (some support was added in 10g). Numbers are held in an internal format and, unless you use an implicit or explicit TO_CHAR, it is up to the "client" to display them (or any desired "prettifying").
select to_number('1e-1') num,
to_char(to_number('1e-1'),'9.9EEEE') sci_num,
to_char(to_number('1e-1')) std_num
from dual;
NUM SCI_NUM ST
--------------- --------- --
.10 1.0E-01 .1
精彩评论