@@ -237,7 +237,7 @@ final class Decimal extends Ordered[Decimal] with Serializable {
237237 if (decimalVal.ne(null )) {
238238 // We get here if either we started with a BigDecimal, or we switched to one because we would
239239 // have overflowed our Long; in either case we must rescale decimalVal to the new scale.
240- val newVal = decimalVal.setScale(scale, ROUNDING_MODE .id )
240+ val newVal = decimalVal.setScale(scale, ROUNDING_MODE )
241241 if (newVal.precision > precision) {
242242 return false
243243 }
@@ -324,17 +324,17 @@ final class Decimal extends Ordered[Decimal] with Serializable {
324324}
325325
326326object Decimal {
327- private val ROUNDING_MODE = RoundingMode .HALF_UP
328- private val MATH_CONTEXT = new MathContext (DecimalType .MAX_PRECISION , ROUNDING_MODE )
329- private val POW_10 = Array .tabulate[Long ](MAX_LONG_DIGITS + 1 )(i => math.pow(10 , i).toLong)
330- private val BIG_DEC_ZERO : JavaBigDecimal = JavaBigDecimal .valueOf(0 )
331-
332327 /** Maximum number of decimal digits a Long can represent */
333328 val MAX_LONG_DIGITS = 18
334329
335330 val ZERO = Decimal (0 )
336331 val ONE = Decimal (1 )
337332
333+ private val ROUNDING_MODE = RoundingMode .HALF_UP
334+ private val MATH_CONTEXT = new MathContext (DecimalType .MAX_PRECISION , ROUNDING_MODE )
335+ private val POW_10 = Array .tabulate[Long ](MAX_LONG_DIGITS + 1 )(i => math.pow(10 , i).toLong)
336+ private val BIG_DEC_ZERO : JavaBigDecimal = JavaBigDecimal .valueOf(0 )
337+
338338 def apply (value : Double ): Decimal = new Decimal ().set(value)
339339
340340 def apply (value : Long ): Decimal = new Decimal ().set(value)
0 commit comments