BigDecimal BigDecimal Class

Definition

An immutable arbitrary-precision signed decimal.

[Android.Runtime.Register("java/math/BigDecimal", ApiSince=1, DoNotGenerateAcw=true)]
public class BigDecimal : Java.Lang.Number, IDisposable, Java.Lang.IComparable
type BigDecimal = class
    inherit Number
    interface ISerializable
    interface IJavaObject
    interface IDisposable
    interface IComparable
Inheritance
Attributes
Implements

Remarks

Android platform documentation

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

BigDecimal(BigInteger) BigDecimal(BigInteger)

Constructs a new BigDecimal instance from the given big integer val.

BigDecimal(BigInteger, Int32) BigDecimal(BigInteger, Int32)

Constructs a new BigDecimal instance from a given unscaled value unscaledVal and a given scale.

BigDecimal(BigInteger, Int32, MathContext) BigDecimal(BigInteger, Int32, MathContext)

Constructs a new BigDecimal instance from a given unscaled value unscaledVal and a given scale.

BigDecimal(BigInteger, MathContext) BigDecimal(BigInteger, MathContext)

Constructs a new BigDecimal instance from the given big integer val.

BigDecimal(Char[]) BigDecimal(Char[])

Constructs a new BigDecimal instance from a string representation given as a character array.

BigDecimal(Char[], Int32, Int32) BigDecimal(Char[], Int32, Int32)

Constructs a new BigDecimal instance from a string representation given as a character array.

BigDecimal(Char[], Int32, Int32, MathContext) BigDecimal(Char[], Int32, Int32, MathContext)

Constructs a new BigDecimal instance from a string representation given as a character array.

BigDecimal(Char[], MathContext) BigDecimal(Char[], MathContext)

Constructs a new BigDecimal instance from a string representation given as a character array.

BigDecimal(Double) BigDecimal(Double)

Constructs a new BigDecimal instance from the 64bit double val.

BigDecimal(Double, MathContext) BigDecimal(Double, MathContext)

Constructs a new BigDecimal instance from the 64bit double val.

BigDecimal(Int32) BigDecimal(Int32)

Constructs a new BigDecimal instance from the given int val.

BigDecimal(Int32, MathContext) BigDecimal(Int32, MathContext)

Constructs a new BigDecimal instance from the given int val.

BigDecimal(Int64) BigDecimal(Int64)

Constructs a new BigDecimal instance from the given long val.

BigDecimal(Int64, MathContext) BigDecimal(Int64, MathContext)

Constructs a new BigDecimal instance from the given long val.

BigDecimal(IntPtr, JniHandleOwnership) BigDecimal(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

BigDecimal(String) BigDecimal(String)

Constructs a new BigDecimal instance from a string representation.

BigDecimal(String, MathContext) BigDecimal(String, MathContext)

Constructs a new BigDecimal instance from a string representation.

Fields

RoundCeiling RoundCeiling

Rounding mode to round towards positive infinity.

RoundDown RoundDown

Rounding mode where the values are rounded towards zero.

RoundFloor RoundFloor

Rounding mode to round towards negative infinity.

RoundHalfDown RoundHalfDown

Rounding mode where values are rounded towards the nearest neighbor.

RoundHalfEven RoundHalfEven

Rounding mode where values are rounded towards the nearest neighbor.

RoundHalfUp RoundHalfUp

Rounding mode where values are rounded towards the nearest neighbor.

RoundUnnecessary RoundUnnecessary

Rounding mode where the rounding operations throws an ArithmeticException for the case that rounding is necessary, i.e. for the case that the value cannot be represented exactly.

RoundUp RoundUp

Rounding mode where positive values are rounded towards positive infinity and negative values towards negative infinity.

Properties

Class Class

Returns the unique instance of Class that represents this object's class.

(Inherited from Object)
Handle Handle

The handle to the underlying Android instance.

(Inherited from Object)
IJavaObjectEx.IsProxy IJavaObjectEx.IsProxy Inherited from Object
IJavaObjectEx.KeyHandle IJavaObjectEx.KeyHandle Inherited from Object
IJavaObjectEx.NeedsActivation IJavaObjectEx.NeedsActivation Inherited from Object
IJavaPeerable.JniManagedPeerState IJavaPeerable.JniManagedPeerState Inherited from Object
JniIdentityHashCode JniIdentityHashCode Inherited from Object
JniPeerMembers JniPeerMembers
One One

The constant one as a BigDecimal.

PeerReference PeerReference Inherited from Object
Ten Ten

The constant ten as a BigDecimal.

ThresholdClass ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Zero Zero

The constant zero as a BigDecimal.

Methods

Abs() Abs()

Returns a BigDecimal whose value is the absolute value of this.

Abs(MathContext) Abs(MathContext)

Returns a BigDecimal whose value is the absolute value of this.

Add(BigDecimal) Add(BigDecimal)

Returns a new BigDecimal whose value is this + augend.

Add(BigDecimal, MathContext) Add(BigDecimal, MathContext)

Returns a new BigDecimal whose value is this + augend.

ByteValue() ByteValue()

Returns this object's value as a byte.

(Inherited from Number)
ByteValueExact() ByteValueExact()

Returns this BigDecimal as a byte value if it has no fractional part and if its value fits to the byte range ([-128.

Clone() Clone()

Creates and returns a copy of this Object.

(Inherited from Object)
CompareTo(BigDecimal) CompareTo(BigDecimal)

Compares this BigDecimal with val.

Dispose() Dispose() Inherited from Object
Dispose(Boolean) Dispose(Boolean) Inherited from Object
Divide(BigDecimal) Divide(BigDecimal)

Returns a new BigDecimal whose value is this / divisor.

Divide(BigDecimal, Int32, RoundingMode) Divide(BigDecimal, Int32, RoundingMode)

Returns a new BigDecimal whose value is this / divisor.

Divide(BigDecimal, Int32, RoundOptions) Divide(BigDecimal, Int32, RoundOptions)

Returns a new BigDecimal whose value is this / divisor.

Divide(BigDecimal, MathContext) Divide(BigDecimal, MathContext)

Returns a new BigDecimal whose value is this / divisor.

Divide(BigDecimal, RoundingMode) Divide(BigDecimal, RoundingMode)

Returns a new BigDecimal whose value is this / divisor.

Divide(BigDecimal, RoundOptions) Divide(BigDecimal, RoundOptions)

Returns a new BigDecimal whose value is this / divisor.

DivideAndRemainder(BigDecimal) DivideAndRemainder(BigDecimal)

Returns a BigDecimal array which contains the integral part of this / divisor at index 0 and the remainder this % divisor at index 1.

DivideAndRemainder(BigDecimal, MathContext) DivideAndRemainder(BigDecimal, MathContext)

Returns a BigDecimal array which contains the integral part of this / divisor at index 0 and the remainder this % divisor at index 1.

DivideToIntegralValue(BigDecimal) DivideToIntegralValue(BigDecimal)

Returns a new BigDecimal whose value is the integral part of this / divisor.

DivideToIntegralValue(BigDecimal, MathContext) DivideToIntegralValue(BigDecimal, MathContext)

Returns a new BigDecimal whose value is the integral part of this / divisor.

DoubleValue() DoubleValue()

Returns this BigDecimal as a double value.

Equals(Object) Equals(Object)

Compares this instance with the specified object and indicates if they are equal.

(Inherited from Object)
FloatValue() FloatValue()

Returns this BigDecimal as a float value.

GetHashCode() GetHashCode()

Returns an integer hash code for this object.

(Inherited from Object)
IntValue() IntValue()

Returns this BigDecimal as an int value.

IntValueExact() IntValueExact()

Returns this BigDecimal as a int value if it has no fractional part and if its value fits to the int range ([-231.

JavaFinalize() JavaFinalize()

Invoked when the garbage collector has detected that this instance is no longer reachable.

(Inherited from Object)
LongValue() LongValue()

Returns this BigDecimal as an long value.

LongValueExact() LongValueExact()

Returns this BigDecimal as a long value if it has no fractional part and if its value fits to the int range ([-263.

Max(BigDecimal) Max(BigDecimal)

Returns the maximum of this BigDecimal and val.

Min(BigDecimal) Min(BigDecimal)

Returns the minimum of this BigDecimal and val.

MovePointLeft(Int32) MovePointLeft(Int32)

Returns a new BigDecimal instance where the decimal point has been moved n places to the left.

MovePointRight(Int32) MovePointRight(Int32)

Returns a new BigDecimal instance where the decimal point has been moved n places to the right.

Multiply(BigDecimal) Multiply(BigDecimal)

Returns a new BigDecimal whose value is this * multiplicand.

Multiply(BigDecimal, MathContext) Multiply(BigDecimal, MathContext)

Returns a new BigDecimal whose value is this * multiplicand.

Negate() Negate()

Returns a new BigDecimal whose value is the -this.

Negate(MathContext) Negate(MathContext)

Returns a new BigDecimal whose value is the -this.

Notify() Notify()

Causes a thread which is waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.

(Inherited from Object)
NotifyAll() NotifyAll()

Causes all threads which are waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.

(Inherited from Object)
Plus() Plus()

Returns a new BigDecimal whose value is +this.

Plus(MathContext) Plus(MathContext)

Returns a new BigDecimal whose value is +this.

Pow(Int32) Pow(Int32)

Returns a new BigDecimal whose value is n.

Pow(Int32, MathContext) Pow(Int32, MathContext)

Returns a new BigDecimal whose value is n.

Precision() Precision()

Returns the precision of this BigDecimal.

Remainder(BigDecimal) Remainder(BigDecimal)

Returns a new BigDecimal whose value is this % divisor.

Remainder(BigDecimal, MathContext) Remainder(BigDecimal, MathContext)

Returns a new BigDecimal whose value is this % divisor.

Round(MathContext) Round(MathContext)

Returns a new BigDecimal whose value is this, rounded according to the passed context mc.

Scale() Scale()

Returns the scale of this BigDecimal.

ScaleByPowerOfTen(Int32) ScaleByPowerOfTen(Int32)

Returns a new BigDecimal whose value is n.

SetHandle(IntPtr, JniHandleOwnership) SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetScale(Int32) SetScale(Int32)

Returns a new BigDecimal instance with the specified scale.

SetScale(Int32, RoundingMode) SetScale(Int32, RoundingMode)

Returns a new BigDecimal instance with the specified scale.

SetScale(Int32, RoundOptions) SetScale(Int32, RoundOptions)

Returns a new BigDecimal instance with the specified scale.

ShortValue() ShortValue()

Returns this object's value as a short.

(Inherited from Number)
ShortValueExact() ShortValueExact()

Returns this BigDecimal as a short value if it has no fractional part and if its value fits to the short range ([-215.

Signum() Signum()

Returns the sign of this BigDecimal.

StripTrailingZeros() StripTrailingZeros()

Returns a new BigDecimal instance with the same value as this but with a unscaled value where the trailing zeros have been removed.

Subtract(BigDecimal) Subtract(BigDecimal)

Returns a new BigDecimal whose value is this - subtrahend.

Subtract(BigDecimal, MathContext) Subtract(BigDecimal, MathContext)

Returns a new BigDecimal whose value is this - subtrahend.

ToArray<T>() ToArray<T>() Inherited from Object
ToBigInteger() ToBigInteger()

Returns this BigDecimal as a big integer instance.

ToBigIntegerExact() ToBigIntegerExact()

Returns this BigDecimal as a big integer instance if it has no fractional part.

ToEngineeringString() ToEngineeringString()

Returns a string representation of this BigDecimal.

ToPlainString() ToPlainString()

Returns a string representation of this BigDecimal.

ToString() ToString()

Returns a string containing a concise, human-readable description of this object.

(Inherited from Object)
Ulp() Ulp()

Returns the unit in the last place (ULP) of this BigDecimal instance.

UnregisterFromRuntime() UnregisterFromRuntime() Inherited from Object
UnscaledValue() UnscaledValue()

Returns the unscaled value (mantissa) of this BigDecimal instance as a BigInteger.

ValueOf(Double) ValueOf(Double)

Returns a new BigDecimal instance whose value is equal to val.

ValueOf(Int64) ValueOf(Int64)

Returns a new BigDecimal instance whose value is equal to unscaledVal.

ValueOf(Int64, Int32) ValueOf(Int64, Int32)

Returns a new BigDecimal instance whose value is equal to -scale).

Wait() Wait()

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.

(Inherited from Object)
Wait(Int64) Wait(Int64)

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

(Inherited from Object)
Wait(Int64, Int32) Wait(Int64, Int32)

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

(Inherited from Object)

Explicit Interface Implementations

IComparable.CompareTo(Object) IComparable.CompareTo(Object)
IJavaObjectEx.ToLocalJniHandle() IJavaObjectEx.ToLocalJniHandle() Inherited from Object
IJavaPeerable.Disposed() IJavaPeerable.Disposed() Inherited from Object
IJavaPeerable.DisposeUnlessReferenced() IJavaPeerable.DisposeUnlessReferenced() Inherited from Object
IJavaPeerable.Finalized() IJavaPeerable.Finalized() Inherited from Object
IJavaPeerable.SetJniIdentityHashCode(Int32) IJavaPeerable.SetJniIdentityHashCode(Int32) Inherited from Object
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) Inherited from Object
IJavaPeerable.SetPeerReference(JniObjectReference) IJavaPeerable.SetPeerReference(JniObjectReference) Inherited from Object

Extension Methods

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable) GetJniTypeName(IJavaPeerable)

Applies to