Skip to content

Commit 9cfaf10

Browse files
committedApr 30, 2019
Never use scientific notation
1 parent b7772d4 commit 9cfaf10

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed
 

‎src/gui/processing/qgsprocessingwidgetwrapperimpl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2206,8 +2206,8 @@ void QgsProcessingPointPanel::clear()
22062206
void QgsProcessingPointPanel::setValue( const QgsPointXY &point, const QgsCoordinateReferenceSystem &crs )
22072207
{
22082208
QString newText = QStringLiteral( "%1,%2" )
2209-
.arg( QString::number( point.x(), 'g', 18 ) )
2210-
.arg( QString::number( point.y(), 'g', 18 ) );
2209+
.arg( QString::number( point.x(), 'f' ) )
2210+
.arg( QString::number( point.y(), 'f' ) );
22112211

22122212
mCrs = crs;
22132213
if ( mCrs.isValid() )

‎tests/src/gui/testprocessinggui.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2834,15 +2834,15 @@ void TestProcessingGui::testPointPanel()
28342834
QSignalSpy spy( panel.get(), &QgsProcessingPointPanel::changed );
28352835

28362836
panel->setValue( QgsPointXY( 100, 150 ), QgsCoordinateReferenceSystem() );
2837-
QCOMPARE( panel->value().toString(), QStringLiteral( "100,150" ) );
2837+
QCOMPARE( panel->value().toString(), QStringLiteral( "100.000000,150.000000" ) );
28382838
QCOMPARE( spy.count(), 1 );
28392839

28402840
panel->setValue( QgsPointXY( 200, 250 ), QgsCoordinateReferenceSystem( QStringLiteral( "EPSG:3111" ) ) );
2841-
QCOMPARE( panel->value().toString(), QStringLiteral( "200,250 [EPSG:3111]" ) );
2841+
QCOMPARE( panel->value().toString(), QStringLiteral( "200.000000,250.000000 [EPSG:3111]" ) );
28422842
QCOMPARE( spy.count(), 2 );
28432843

2844-
panel->setValue( QgsPointXY( 123456.123456789122, 654321.987654321012 ), QgsCoordinateReferenceSystem() );
2845-
QCOMPARE( panel->value().toString(), QStringLiteral( "123456.123456789122,654321.987654321012" ) );
2844+
panel->setValue( QgsPointXY( 123456.123456789, 654321.987654321 ), QgsCoordinateReferenceSystem() );
2845+
QCOMPARE( panel->value().toString(), QStringLiteral( "123456.123457,654321.987654" ) );
28462846
QCOMPARE( spy.count(), 3 );
28472847

28482848
QVERIFY( !panel->mLineEdit->showClearButton() );
@@ -2856,7 +2856,7 @@ void TestProcessingGui::testPointPanel()
28562856
canvas.setDestinationCrs( QgsCoordinateReferenceSystem( QStringLiteral( "EPSG:28356" ) ) );
28572857
panel->setMapCanvas( &canvas );
28582858
panel->updatePoint( QgsPointXY( 1.5, -3.5 ) );
2859-
QCOMPARE( panel->value().toString(), QStringLiteral( "1.5,-3.5 [EPSG:28356]" ) );
2859+
QCOMPARE( panel->value().toString(), QStringLiteral( "1.500000,-3.500000 [EPSG:28356]" ) );
28602860
QCOMPARE( spy.count(), 5 );
28612861

28622862
panel.reset();
@@ -2879,8 +2879,8 @@ void TestProcessingGui::testPointWrapper()
28792879
QCOMPARE( spy.count(), 1 );
28802880
if ( type != QgsProcessingGui::Modeler )
28812881
{
2882-
QCOMPARE( wrapper.widgetValue().toString(), QStringLiteral( "1,2" ) );
2883-
QCOMPARE( static_cast< QgsProcessingPointPanel * >( wrapper.wrappedWidget() )->mLineEdit->text(), QStringLiteral( "1,2" ) );
2882+
QCOMPARE( wrapper.widgetValue().toString(), QStringLiteral( "1.000000,2.000000" ) );
2883+
QCOMPARE( static_cast< QgsProcessingPointPanel * >( wrapper.wrappedWidget() )->mLineEdit->text(), QStringLiteral( "1.000000,2.000000" ) );
28842884
}
28852885
else
28862886
{
@@ -2891,8 +2891,8 @@ void TestProcessingGui::testPointWrapper()
28912891
QCOMPARE( spy.count(), 2 );
28922892
if ( type != QgsProcessingGui::Modeler )
28932893
{
2894-
QCOMPARE( wrapper.widgetValue().toString(), QStringLiteral( "1,2 [EPSG:3111]" ) );
2895-
QCOMPARE( static_cast< QgsProcessingPointPanel * >( wrapper.wrappedWidget() )->mLineEdit->text(), QStringLiteral( "1,2 [EPSG:3111]" ) );
2894+
QCOMPARE( wrapper.widgetValue().toString(), QStringLiteral( "1.000000,2.000000 [EPSG:3111]" ) );
2895+
QCOMPARE( static_cast< QgsProcessingPointPanel * >( wrapper.wrappedWidget() )->mLineEdit->text(), QStringLiteral( "1.000000,2.000000 [EPSG:3111]" ) );
28962896
}
28972897
else
28982898
{
@@ -2939,8 +2939,8 @@ void TestProcessingGui::testPointWrapper()
29392939
QCOMPARE( spy2.count(), 1 );
29402940
if ( type != QgsProcessingGui::Modeler )
29412941
{
2942-
QCOMPARE( static_cast< QgsProcessingPointPanel * >( wrapper2.wrappedWidget() )->mLineEdit->text(), QStringLiteral( "1,2" ) );
2943-
QCOMPARE( wrapper2.widgetValue().toString(), QStringLiteral( "1,2" ) );
2942+
QCOMPARE( static_cast< QgsProcessingPointPanel * >( wrapper2.wrappedWidget() )->mLineEdit->text(), QStringLiteral( "1.000000,2.000000" ) );
2943+
QCOMPARE( wrapper2.widgetValue().toString(), QStringLiteral( "1.000000,2.000000" ) );
29442944
}
29452945
else
29462946
{
@@ -2952,8 +2952,8 @@ void TestProcessingGui::testPointWrapper()
29522952
QCOMPARE( spy2.count(), 2 );
29532953
if ( type != QgsProcessingGui::Modeler )
29542954
{
2955-
QCOMPARE( wrapper2.widgetValue().toString(), QStringLiteral( "1,2 [EPSG:3111]" ) );
2956-
QCOMPARE( static_cast< QgsProcessingPointPanel * >( wrapper2.wrappedWidget() )->mLineEdit->text(), QStringLiteral( "1,2 [EPSG:3111]" ) );
2955+
QCOMPARE( wrapper2.widgetValue().toString(), QStringLiteral( "1.000000,2.000000 [EPSG:3111]" ) );
2956+
QCOMPARE( static_cast< QgsProcessingPointPanel * >( wrapper2.wrappedWidget() )->mLineEdit->text(), QStringLiteral( "1.000000,2.000000 [EPSG:3111]" ) );
29572957
}
29582958
else
29592959
{

0 commit comments

Comments
 (0)
Please sign in to comment.