Commits

Niklas Nebel  committed 4a5906c

calc63: #i115512# RoundValueAsShown: don't round to -1 digits for unlimited precision

  • Participants
  • Parent commits 34ed029

Comments (0)

Files changed (1)

File sc/source/core/data/documen4.cxx

 	  && nType != NUMBERFORMAT_TIME && nType != NUMBERFORMAT_DATETIME )
 	{
 		short nPrecision;
-		if ( nFormat )
+        if ((nFormat % SV_COUNTRY_LANGUAGE_OFFSET) != 0)
 		{
 			nPrecision = (short)GetFormatTable()->GetFormatPrecision( nFormat );
 			switch ( nType )
 			}
 		}
 		else
+        {
 			nPrecision = (short)GetDocOptions().GetStdPrecision();
+            // #i115512# no rounding for automatic decimals
+            if (nPrecision == static_cast<short>(SvNumberFormatter::UNLIMITED_PRECISION))
+                return fVal;
+        }
 		double fRound = ::rtl::math::round( fVal, nPrecision );
 		if ( ::rtl::math::approxEqual( fVal, fRound ) )
 			return fVal;		// durch Rundung hoechstens Fehler