diff --git a/Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/PeakColumn.h b/Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/PeakColumn.h index 0bc8a672c535fcf04901837fcd3a298e2c4538c0..8a618c2863fa9467c19fa22eed49e8f12444f879 100644 --- a/Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/PeakColumn.h +++ b/Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/PeakColumn.h @@ -77,6 +77,8 @@ namespace DataObjects private: /// Reference to the peaks object saved in the PeaksWorkspace. std::vector<Peak> & m_peaks; + /// Precision of hkl in table workspace + int m_hklPrec; /// Type of the row cache value typedef boost::variant<double,int,std::string,Kernel::V3D> CacheValueType; diff --git a/Code/Mantid/Framework/DataObjects/src/PeakColumn.cpp b/Code/Mantid/Framework/DataObjects/src/PeakColumn.cpp index 377e1bfd2582d0d6a98732006b5eabf1b32862a3..b8978ac70ea49a878920d5de748bb3f5fef17040 100644 --- a/Code/Mantid/Framework/DataObjects/src/PeakColumn.cpp +++ b/Code/Mantid/Framework/DataObjects/src/PeakColumn.cpp @@ -79,6 +79,8 @@ namespace DataObjects { this->m_name = name; this->m_type = typeFromName(name); // Throws if the name is unknown + this->m_hklPrec = 2; + ConfigService::Instance().getValue("PeakColumn.hklPrec",this->m_hklPrec); } //---------------------------------------------------------------------------------------------- @@ -165,21 +167,15 @@ namespace DataObjects s << peak.getQSampleFrame(); else if (m_name == "h") { - int hklPrec = 2; - ConfigService::Instance().getValue("PeakColumn.hklPrec",hklPrec); - s << std::fixed << std::setprecision(hklPrec) << peak.getH(); + s << std::fixed << std::setprecision(m_hklPrec) << peak.getH(); } else if (m_name == "k") { - int hklPrec = 2; - ConfigService::Instance().getValue("PeakColumn.hklPrec",hklPrec); - s << std::fixed << std::setprecision(hklPrec) << peak.getK(); + s << std::fixed << std::setprecision(m_hklPrec) << peak.getK(); } else if (m_name == "l") { - int hklPrec = 2; - ConfigService::Instance().getValue("PeakColumn.hklPrec",hklPrec); - s << std::fixed << std::setprecision(hklPrec) << peak.getL(); + s << std::fixed << std::setprecision(m_hklPrec) << peak.getL(); } else s << peak.getValueByColName(m_name);