Skip to content
Permalink
Browse files

add scientific notation for double type when precision is mentionned

  • Loading branch information
speillet authored and mhugo committed Dec 20, 2019
1 parent 5fe6bb8 commit 18f65c6345c9f64a0f418f12b3f538cbb71f09ef
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/core/qgsfield.cpp
@@ -235,7 +235,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 18f65c6

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