Skip to content
Permalink
Browse files

Attempt to workaround mscv behavior

  • Loading branch information
nyalldawson committed Jan 6, 2020
1 parent a72d8fa commit e91f26d617584fedc586bea5a0d2e1f8db341ed2
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/core/numericformats/qgsbasicnumericformat.cpp
@@ -19,6 +19,7 @@
#include <memory>
#include <iostream>
#include <locale>
#include <iomanip>

struct formatter : std::numpunct<char>
{
@@ -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() );

0 comments on commit e91f26d

Please sign in to comment.
You can’t perform that action at this time.