diff --git a/plugins/robots/common/trikKit/src/blocks/details/trikPrintTextBlock.cpp b/plugins/robots/common/trikKit/src/blocks/details/trikPrintTextBlock.cpp index b147cbf2d3..872123c709 100644 --- a/plugins/robots/common/trikKit/src/blocks/details/trikPrintTextBlock.cpp +++ b/plugins/robots/common/trikKit/src/blocks/details/trikPrintTextBlock.cpp @@ -30,9 +30,7 @@ void TrikPrintTextBlock::doJob(kitBase::robotModel::robotParts::Display &display const int x = eval("XCoordinateText"); const int y = eval("YCoordinateText"); const int fontSize = eval("FontSize"); - const QString result = boolProperty("Evaluate") - ? QString::number(QString::number(eval("PrintText"), 'f', 6).toDouble()) - : stringProperty("PrintText"); + const QString result = boolProperty("Evaluate") ? eval("PrintText") : stringProperty("PrintText"); const bool redraw = boolProperty("Redraw"); if (!errorsOccured()) { diff --git a/plugins/robots/interpreters/interpreterCore/src/coreBlocks/details/printTextBlock.cpp b/plugins/robots/interpreters/interpreterCore/src/coreBlocks/details/printTextBlock.cpp index 5db320ac54..18632cf124 100644 --- a/plugins/robots/interpreters/interpreterCore/src/coreBlocks/details/printTextBlock.cpp +++ b/plugins/robots/interpreters/interpreterCore/src/coreBlocks/details/printTextBlock.cpp @@ -28,9 +28,7 @@ void PrintTextBlock::doJob(kitBase::robotModel::robotParts::Display &display) { const int x = eval("XCoordinateText"); const int y = eval("YCoordinateText"); - const QString result = boolProperty("Evaluate") - ? QString::number(QString::number(eval("PrintText"), 'f', 6).toDouble()) - : stringProperty("PrintText"); + const QString result = boolProperty("Evaluate") ? eval("PrintText") : stringProperty("PrintText"); const bool redraw = boolProperty("Redraw"); if (!errorsOccured()) { diff --git a/plugins/robots/interpreters/interpreterCore/src/textLanguage/robotsBlockParser.cpp b/plugins/robots/interpreters/interpreterCore/src/textLanguage/robotsBlockParser.cpp index b1a57f811b..a2d976cacf 100644 --- a/plugins/robots/interpreters/interpreterCore/src/textLanguage/robotsBlockParser.cpp +++ b/plugins/robots/interpreters/interpreterCore/src/textLanguage/robotsBlockParser.cpp @@ -161,7 +161,9 @@ void RobotsBlockParser::addIntrinsicFuctions() , std::function const &function) { add1aryFunction(name, new types::Float, new types::Float - , [function](const QVariant &arg) { return function(arg.toReal()); }); + , [function](const QVariant &arg) { + return QString::number(function(arg.toReal()), 'f').toDouble(); + }); }; const auto addIntegerFunction = [add1aryFunction] (const QString &name