#7667 Refactor: extract number format settings for reuse.

This commit is contained in:
Kristian Bendiksen
2021-05-28 15:56:54 +02:00
committed by Magne Sjaastad
parent 5d703b2a08
commit b2025fbeef
8 changed files with 119 additions and 61 deletions

View File

@@ -35,7 +35,7 @@ RiuScalarMapperLegendFrame::RiuScalarMapperLegendFrame( QWidget* parent, const Q
: RiuAbstractLegendFrame( parent, title )
, m_scalarMapper( scalarMapper )
, m_tickNumberPrecision( 4 )
, m_numberFormat( RimRegularLegendConfig::NumberFormatType::AUTO )
, m_numberFormat( RiaNumberFormat::NumberFormatType::AUTO )
{
if ( m_scalarMapper.notNull() )
{
@@ -126,7 +126,7 @@ void RiuScalarMapperLegendFrame::layoutInfo( LayoutInfo* layout ) const
QString RiuScalarMapperLegendFrame::label( int index ) const
{
double tickValue = m_tickValues[index];
return RimRegularLegendConfig::valueToText( tickValue, m_numberFormat, m_tickNumberPrecision );
return RiaNumberFormat::valueToText( tickValue, m_numberFormat, m_tickNumberPrecision );
}
//--------------------------------------------------------------------------------------------------