Skip to content
Permalink
Browse files

add scientific notation for double type when precision is mentionned

  • Loading branch information
speillet
speillet committed Dec 20, 2019
1 parent c343207 commit 87bb68bd04f1ac65dbf901a00ddcb9f4316e3e52
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/core/qgsfield.cpp
@@ -224,7 +224,14 @@ QString QgsField::displayString( const QVariant &v ) const
{
if ( d->precision > 0 )
{
return QLocale().toString( v.toDouble(), 'f', d->precision );
if ( -1 < v.toDouble() && v.toDouble() < 1 )
{
return QLocale().toString( v.toDouble(), 'g', d->precision );
}
else
{
return QLocale().toString( v.toDouble(), 'f', d->precision );
}
}
else
{

0 comments on commit 87bb68b

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