Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Turn scientific into fixed in UI

Turn scientific into fixed in UI

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 446 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Raminlich
    wrote on last edited by
    #1

    hi all

    in my code the output of the final line will be like this 1e+06
    now i want to turn into fixed number and dont know how to do it.
    in console standard c++ i do this like this:

    @
    cout<<fixed<<z;
    @

    @void MainWindow::on_pushButton_2_clicked()
    {
    QString b;
    float x,y,z;
    x=ui->lineEdit_3->text().toLong();
    y=ui->lineEdit_4->text().toLong();
    z=x*y;
    z=(float)z/100;
    cout<<fixed;
    ui->textBrowser_2->setText(b.setNum(z));

    }@

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved