@@ -285,8 +285,8 @@ bool QgsField::convertCompatible( QVariant &v ) const
285
285
if ( !tmp.convert ( d->type ) )
286
286
{
287
287
// This might be a string with thousand separator: use locale to convert
288
- bool ok;
289
- double d = QLocale (). toDouble ( v.toString (), & ok );
288
+ bool ok = false ;
289
+ double d = qgsPermissiveToDouble ( v.toString (), ok );
290
290
if ( ok )
291
291
{
292
292
v = QVariant ( d );
@@ -295,7 +295,7 @@ bool QgsField::convertCompatible( QVariant &v ) const
295
295
// For not 'dot' locales, we also want to accept '.'
296
296
if ( QLocale ().decimalPoint () != ' .' )
297
297
{
298
- d = QLocale ( QLocale::English ).toDouble ( v.toString (), &ok );
298
+ d = QLocale ( QLocale::C ).toDouble ( v.toString (), &ok );
299
299
if ( ok )
300
300
{
301
301
v = QVariant ( d );
@@ -313,7 +313,7 @@ bool QgsField::convertCompatible( QVariant &v ) const
313
313
{
314
314
// This might be a string with thousand separator: use locale to convert
315
315
bool ok;
316
- int i = QLocale (). toInt ( v.toString (), & ok );
316
+ int i = qgsPermissiveToInt ( v.toString (), ok );
317
317
if ( ok )
318
318
{
319
319
v = QVariant ( i );
@@ -330,7 +330,7 @@ bool QgsField::convertCompatible( QVariant &v ) const
330
330
{
331
331
// This might be a string with thousand separator: use locale to convert
332
332
bool ok;
333
- qlonglong l = QLocale (). toLongLong ( v.toString (), & ok );
333
+ qlonglong l = qgsPermissiveToLongLong ( v.toString (), ok );
334
334
if ( ok )
335
335
{
336
336
v = QVariant ( l );
0 commit comments