代码之家  ›  专栏  ›  技术社区  ›  yesraaj

如何将指数形式的浮点值转换成点表示法?[复制]

  •  2
  • yesraaj  · 技术社区  · 15 年前

    可能重复:
    Prevent scientific notation in ostream when using << with double

    2 回复  |  直到 9 年前
        1
  •  5
  •   James McNellis    15 年前

    你可以使用 fixed I/O操纵器强制以定点表示法打印数字:

    double d = 42.0;
    std::cout << std::fixed << d;
    

    ( std::scientific 相反:它强制数字以科学记数法打印)

        2
  •  0
  •   Gary Myers    15 年前

    some support was added in 10g ).

    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