Skip to content

Commit

Permalink
Attempt to workaround mscv behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jan 8, 2020
1 parent a72d8fa commit e91f26d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/numericformats/qgsbasicnumericformat.cpp
Expand Up @@ -19,6 +19,7 @@
#include <memory>
#include <iostream>
#include <locale>
#include <iomanip>

struct formatter : std::numpunct<char>
{
Expand Down Expand Up @@ -51,15 +52,14 @@ QString QgsBasicNumericFormat::formatDouble( double value, const QgsNumericForma
{
mOs = qgis::make_unique< std::ostringstream >();
mOs->imbue( std::locale( mOs->getloc(), new formatter( context.thousandsSeparator(), mShowThousandsSeparator, context.decimalSeparator() ) ) );
mOs->precision( mNumberDecimalPlaces );
mPrevThousandsSep = context.thousandsSeparator();
mPrevDecimalSep = context.decimalSeparator();
}

if ( !mUseScientific )
*mOs << std::fixed;
*mOs << std::fixed << std::setprecision( mNumberDecimalPlaces );
else
*mOs << std::scientific;
*mOs << std::scientific << std::setprecision( mNumberDecimalPlaces );

*mOs << value;
QString res = QString::fromStdString( mOs->str() );
Expand Down

0 comments on commit e91f26d

Please sign in to comment.