From: sbh Date: Mon, 24 Dec 2012 07:21:06 +0000 (+0000) Subject: SPO: Fix: Function DoubleToQString returns empty string when value = 0.0 and removeZe... X-Git-Tag: V5_2_5~13 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=476efd3b969ccff77a03b5d7599fdaef694c8757;p=modules%2Fgui.git SPO: Fix: Function DoubleToQString returns empty string when value = 0.0 and removeZeroes = true --- diff --git a/src/TableViewer/TableViewer_Tool.cxx b/src/TableViewer/TableViewer_Tool.cxx index f193b1a3f..9b98e2e35 100755 --- a/src/TableViewer/TableViewer_Tool.cxx +++ b/src/TableViewer/TableViewer_Tool.cxx @@ -107,11 +107,13 @@ QString TableViewer_Tool::DoubleToQString( const double value, delete aBuf; std::string aNewResult = ""; int aCounter = 0; - for ( int jj = aResultStr.size()-1; jj >=aWholePartStr.size(); --jj ) { - if ( aResultStr.at(jj) == '0' || aResultStr.at( jj ) == '.' ) - aCounter++; - else - break; + if ( aResultStr.find( '.' ) != std::string::npos ) { + for ( int jj = aResultStr.size()-1; jj >=aWholePartStr.size(); --jj ) { + if ( aResultStr.at(jj) == '0' || aResultStr.at( jj ) == '.' ) + aCounter++; + else + break; + } } for ( int ii = 0; ii