Packages

object BigDecimal extends java.io.Serializable

Source
BigDecimal.scala
Since

2.7

Linear Supertypes
java.io.Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. BigDecimal
  2. Serializable
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. def apply(bd: java.math.BigDecimal): BigDecimal

    Constructs a BigDecimal from a java.math.BigDecimal.

  2. def apply(unscaledVal: BigInt, scale: Int, mc: MathContext): BigDecimal

    Constructs a BigDecimal whose unscaled value is equal to that of the specified BigInt value.

    Constructs a BigDecimal whose unscaled value is equal to that of the specified BigInt value.

    unscaledVal

    the specified BigInt value

    scale

    the scale

    mc

    the precision and rounding mode for creation of this value and future operations on it

    returns

    the constructed BigDecimal

  3. def apply(unscaledVal: BigInt, scale: Int): BigDecimal

    Constructs a BigDecimal whose unscaled value is equal to that of the specified BigInt value.

    Constructs a BigDecimal whose unscaled value is equal to that of the specified BigInt value.

    unscaledVal

    the specified BigInt value

    scale

    the scale

    returns

    the constructed BigDecimal

  4. def apply(x: BigInt, mc: MathContext): BigDecimal

    Constructs a BigDecimal whose value is equal to that of the specified BigInt value, rounding if necessary.

    Constructs a BigDecimal whose value is equal to that of the specified BigInt value, rounding if necessary.

    x

    the specified BigInt value

    mc

    the precision and rounding mode for creation of this value and future operations on it

    returns

    the constructed BigDecimal

  5. def apply(x: BigInt): BigDecimal

    Constructs a BigDecimal whose value is equal to that of the specified BigInt value.

    Constructs a BigDecimal whose value is equal to that of the specified BigInt value.

    x

    the specified BigInt value

    returns

    the constructed BigDecimal

  6. def apply(x: String, mc: MathContext): BigDecimal

    Translates the decimal String representation of a BigDecimal into a BigDecimal, rounding if necessary.

  7. def apply(x: String): BigDecimal

    Translates the decimal String representation of a BigDecimal into a BigDecimal.

  8. def apply(x: Array[Char], mc: MathContext): BigDecimal

    Translates a character array representation of a BigDecimal into a BigDecimal, rounding if necessary.

  9. def apply(x: Array[Char]): BigDecimal

    Translates a character array representation of a BigDecimal into a BigDecimal.

  10. def apply(d: Double, mc: MathContext): BigDecimal

    Constructs a BigDecimal whose value is equal to that of the specified double value, but rounded if necessary.

    Constructs a BigDecimal whose value is equal to that of the specified double value, but rounded if necessary. Equivalent to BigDecimal.decimal.

    d

    the specified Double value

    mc

    the precision and rounding mode for creation of this value and future operations on it

    returns

    the constructed BigDecimal

  11. def apply(d: Double): BigDecimal

    Constructs a BigDecimal whose value is equal to that of the specified double value.

    Constructs a BigDecimal whose value is equal to that of the specified double value. Equivalent to BigDecimal.decimal.

    d

    the specified Double value

    returns

    the constructed BigDecimal

  12. def apply(unscaledVal: Long, scale: Int, mc: MathContext): BigDecimal

    Constructs a BigDecimal whose unscaled value is equal to that of the specified long value, but rounded if necessary.

    Constructs a BigDecimal whose unscaled value is equal to that of the specified long value, but rounded if necessary.

    unscaledVal

    the value

    scale

    the scale

    mc

    the precision and rounding mode for creation of this value and future operations on it

    returns

    the constructed BigDecimal

  13. def apply(unscaledVal: Long, scale: Int): BigDecimal

    Constructs a BigDecimal whose unscaled value is equal to that of the specified long value.

    Constructs a BigDecimal whose unscaled value is equal to that of the specified long value.

    unscaledVal

    the value

    scale

    the scale

    returns

    the constructed BigDecimal

  14. def apply(l: Long, mc: MathContext): BigDecimal

    Constructs a BigDecimal whose value is equal to that of the specified long value, but rounded if necessary.

    Constructs a BigDecimal whose value is equal to that of the specified long value, but rounded if necessary.

    l

    the specified long value

    mc

    the precision and rounding mode for creation of this value and future operations on it

    returns

    the constructed BigDecimal

  15. def apply(l: Long): BigDecimal

    Constructs a BigDecimal whose value is equal to that of the specified long value.

    Constructs a BigDecimal whose value is equal to that of the specified long value.

    l

    the specified long value

    returns

    the constructed BigDecimal

  16. def apply(i: Int, mc: MathContext): BigDecimal

    Constructs a BigDecimal whose value is equal to that of the specified Integer value, rounding if necessary.

    Constructs a BigDecimal whose value is equal to that of the specified Integer value, rounding if necessary.

    i

    the specified integer value

    mc

    the precision and rounding mode for creation of this value and future operations on it

    returns

    the constructed BigDecimal

  17. def apply(i: Int): BigDecimal

    Constructs a BigDecimal whose value is equal to that of the specified Integer value.

    Constructs a BigDecimal whose value is equal to that of the specified Integer value.

    i

    the specified integer value

    returns

    the constructed BigDecimal

  18. def binary(d: Double): BigDecimal

    Constructs a BigDecimal by expanding the binary fraction contained by Double value d into a decimal representation.

    Constructs a BigDecimal by expanding the binary fraction contained by Double value d into a decimal representation. Note: this also works correctly on converted Floats.

  19. def binary(d: Double, mc: MathContext): BigDecimal

    Constructs a BigDecimal by expanding the binary fraction contained by Double value d into a decimal representation, rounding if necessary.

    Constructs a BigDecimal by expanding the binary fraction contained by Double value d into a decimal representation, rounding if necessary. When a Float is converted to a Double, the binary fraction is preserved, so this method also works for converted Floats.

  20. def decimal(bd: java.math.BigDecimal, mc: MathContext): BigDecimal

    Constructs a BigDecimal using a java.math.BigDecimal, rounding if necessary.

  21. def decimal(l: Long): BigDecimal

    Constructs a BigDecimal from a Long.

    Constructs a BigDecimal from a Long. This is identical to BigDecimal(l).

  22. def decimal(l: Long, mc: MathContext): BigDecimal

    Constructs a BigDecimal from a Long, rounding if necessary.

    Constructs a BigDecimal from a Long, rounding if necessary. This is identical to BigDecimal(l, mc).

  23. def decimal(f: Float): BigDecimal

    Constructs a BigDecimal using the decimal text representation of Float value f.

    Constructs a BigDecimal using the decimal text representation of Float value f. Note that BigDecimal.decimal(0.1f) != 0.1f since equality agrees with the Double representation, and 0.1 != 0.1f.

  24. def decimal(f: Float, mc: MathContext): BigDecimal

    Constructs a BigDecimal using the decimal text representation of Float value f, rounding if necessary.

    Constructs a BigDecimal using the decimal text representation of Float value f, rounding if necessary. Note that BigDecimal.decimal(0.1f) != 0.1f since equality agrees with the Double representation, and 0.1 != 0.1f.

  25. def decimal(d: Double): BigDecimal

    Constructs a BigDecimal using the decimal text representation of Double value d.

  26. def decimal(d: Double, mc: MathContext): BigDecimal

    Constructs a BigDecimal using the decimal text representation of Double value d, rounding if necessary.

  27. val defaultMathContext: MathContext
  28. implicit def double2bigDecimal(d: Double): BigDecimal

    Implicit conversion from Double to BigDecimal.

  29. def exact(cs: Array[Char]): BigDecimal

    Constructs a BigDecimal that exactly represents the number specified in base 10 in a character array.

  30. def exact(s: String): BigDecimal

    Constructs a BigDecimal that exactly represents the number specified in a String.

  31. def exact(l: Long): BigDecimal

    Constructs a BigDecimal that exactly represents a Long.

    Constructs a BigDecimal that exactly represents a Long. Note that all creation methods for BigDecimal that do not take a MathContext represent a Long; this is equivalent to apply, valueOf, etc..

  32. def exact(bi: BigInt): BigDecimal

    Constructs a BigDecimal that exactly represents a BigInt.

  33. def exact(d: Double): BigDecimal

    Constructs a BigDecimal by fully expanding the binary fraction contained by Double value d, adjusting the precision as necessary.

    Constructs a BigDecimal by fully expanding the binary fraction contained by Double value d, adjusting the precision as necessary. Note: this works correctly on converted Floats also.

  34. def exact(repr: java.math.BigDecimal): BigDecimal

    Constructs a BigDecimal from a java.math.BigDecimal.

    Constructs a BigDecimal from a java.math.BigDecimal. The precision is the default for BigDecimal or enough to represent the java.math.BigDecimal exactly, whichever is greater.

  35. implicit def int2bigDecimal(i: Int): BigDecimal

    Implicit conversion from Int to BigDecimal.

  36. implicit def javaBigDecimal2bigDecimal(x: java.math.BigDecimal): BigDecimal

    Implicit conversion from java.math.BigDecimal to scala.BigDecimal.

  37. implicit def long2bigDecimal(l: Long): BigDecimal

    Implicit conversion from Long to BigDecimal.

  38. def valueOf(x: Long): BigDecimal

    Constructs a BigDecimal using the java BigDecimal static valueOf constructor.

    Constructs a BigDecimal using the java BigDecimal static valueOf constructor.

    x

    the specified Long value

    returns

    the constructed BigDecimal

  39. def valueOf(d: Double): BigDecimal

    Constructs a BigDecimal using the java BigDecimal static valueOf constructor.

    Constructs a BigDecimal using the java BigDecimal static valueOf constructor. Equivalent to BigDecimal.decimal.

    d

    the specified double value

    returns

    the constructed BigDecimal

  40. object RoundingMode extends Enumeration