Skip to content

Commit 194715a

Browse files
committed
limit float values in rviz to 4 digits
The previous implicit conversion leads to varying cell width.
1 parent a9fbcac commit 194715a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

visualization/motion_planning_tasks/src/remote_task_model.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ QVariant RemoteTaskModel::data(const QModelIndex& index, int role) const {
255255
case 2:
256256
return n->solutions_->numFailed();
257257
case 3:
258-
return n->solutions_->totalComputeTime();
258+
return QLocale().toString(n->solutions_->totalComputeTime(), 'f', 4);
259259
}
260260
break;
261261
case Qt::ForegroundRole:
@@ -521,7 +521,7 @@ QVariant RemoteSolutionModel::data(const QModelIndex& index, int role) const {
521521
return tr(u8"");
522522
if (std::isnan(item.cost))
523523
return QVariant();
524-
return item.cost;
524+
return QLocale().toString(item.cost, 'f', 4);
525525
case 2:
526526
return item.comment;
527527
}

0 commit comments

Comments
 (0)