小编Gie*_*nut的帖子

qt - decimals and round up to whole numbers

This is what I've got so far but I can't figure out my next steps.

When I divide my value with 3 I get whole numbers but I want it to display with one decimal and I don't know how.

When that's done I want to round the decimal up or down depending on its value. If it's 3.5 or over it should become 4 and if it's 3.4 or under it should be 3.

void MainWindow::on_pushButton_clicked(){

int paragraph = …
Run Code Online (Sandbox Code Playgroud)

c++ qt

5
推荐指数
2
解决办法
2万
查看次数

标签 统计

c++ ×1

qt ×1