BigDecimal Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
BigDecimal(BigDecimal) |
Constructs a |
BigDecimal(IntPtr, JniHandleOwnership) | |
BigDecimal(BigInteger, Int32) |
Constructs a |
BigDecimal(String) |
Constructs a |
BigDecimal(Int64) |
Constructs a |
BigDecimal(Char[], Int32, Int32) |
Constructs a |
BigDecimal(Double) |
Constructs a |
BigDecimal(Char[]) |
Constructs a |
BigDecimal(BigInteger) |
Constructs a |
BigDecimal(Int32) |
Constructs a |
BigDecimal(BigDecimal)
Constructs a BigDecimal
object from a java.math.BigDecimal
.
[Android.Runtime.Register(".ctor", "(Ljava/math/BigDecimal;)V", "", ApiSince=24)]
public BigDecimal (Java.Math.BigDecimal? bd);
[<Android.Runtime.Register(".ctor", "(Ljava/math/BigDecimal;)V", "", ApiSince=24)>]
new Android.Icu.Math.BigDecimal : Java.Math.BigDecimal -> Android.Icu.Math.BigDecimal
Parameters
- bd
- BigDecimal
The BigDecimal
to be translated.
- Attributes
Remarks
Constructs a BigDecimal
object from a java.math.BigDecimal
.
Constructs a BigDecimal
as though the parameter had been represented as a String
(using its toString
method) and the #BigDecimal(java.lang.String)
constructor had then been used. The parameter must not be null
.
(Note: this constructor is provided only in the android.icu.math
version of the BigDecimal class. It would not be present in a java.math
version.)
Java documentation for android.icu.math.BigDecimal.BigDecimal(java.math.BigDecimal)
.
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.
Applies to
BigDecimal(IntPtr, JniHandleOwnership)
protected BigDecimal (IntPtr javaReference, Android.Runtime.JniHandleOwnership transfer);
new Android.Icu.Math.BigDecimal : nativeint * Android.Runtime.JniHandleOwnership -> Android.Icu.Math.BigDecimal
Parameters
- javaReference
-
IntPtr
nativeint
- transfer
- JniHandleOwnership
Remarks
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.
Applies to
BigDecimal(BigInteger, Int32)
Constructs a BigDecimal
object from a BigInteger
and a scale.
[Android.Runtime.Register(".ctor", "(Ljava/math/BigInteger;I)V", "", ApiSince=24)]
public BigDecimal (Java.Math.BigInteger? bi, int scale);
[<Android.Runtime.Register(".ctor", "(Ljava/math/BigInteger;I)V", "", ApiSince=24)>]
new Android.Icu.Math.BigDecimal : Java.Math.BigInteger * int -> Android.Icu.Math.BigDecimal
Parameters
- bi
- BigInteger
The BigInteger
to be converted.
- scale
- Int32
The int
specifying the scale.
- Attributes
Remarks
Constructs a BigDecimal
object from a BigInteger
and a scale.
Constructs a BigDecimal
which is the exact decimal representation of the BigInteger
, scaled by the second parameter, which may not be negative. The value of the BigDecimal
is the BigInteger
divided by ten to the power of the scale. The BigInteger
parameter must not be null
.
The BigDecimal
will contain only decimal digits, (with an embedded decimal point followed by scale
decimal digits if the scale is positive), prefixed with a leading minus sign (hyphen) if the BigInteger
is negative. A leading zero will be present only if the BigInteger
is zero.
Java documentation for android.icu.math.BigDecimal.BigDecimal(java.math.BigInteger, int)
.
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.
Applies to
BigDecimal(String)
Constructs a BigDecimal
object from a String
.
[Android.Runtime.Register(".ctor", "(Ljava/lang/String;)V", "", ApiSince=24)]
public BigDecimal (string? string);
[<Android.Runtime.Register(".ctor", "(Ljava/lang/String;)V", "", ApiSince=24)>]
new Android.Icu.Math.BigDecimal : string -> Android.Icu.Math.BigDecimal
Parameters
- string
- String
The String
to be converted.
- Attributes
Remarks
Constructs a BigDecimal
object from a String
.
Constructs a BigDecimal
from the parameter, which must not be null
and must represent a valid number, as described formally in the documentation referred to BigDecimal above
.
In summary, numbers in String
form must have at least one digit, may have a leading sign, may have a decimal point, and exponential notation may be used. They follow conventional syntax, and may not contain blanks.
Some valid strings from which a BigDecimal
might be constructed are:
"0" -- Zero "12" -- A whole number "-76" -- A signed whole number "12.70" -- Some decimal places "+0.003" -- Plus
sign is allowed "17." -- The same as 17 ".5" -- The same as 0.5 "4E+9" -- Exponential notation "0.73e-7" --
Exponential notation
(Exponential notation means that the number includes an optional sign and a power of ten following an 'E
' that indicates how the decimal point will be shifted. Thus the "4E+9"
above is just a short way of writing 4000000000
, and the "0.73e-7"
is short for 0.000000073
.)
The BigDecimal
constructed from the String is in a standard form, with no blanks, as though the #add(BigDecimal)
method had been used to add zero to the number with unlimited precision. If the string uses exponential notation (that is, includes an e
or an E
), then the BigDecimal
number will be expressed in scientific notation (where the power of ten is adjusted so there is a single non-zero digit to the left of the decimal point); in this case if the number is zero then it will be expressed as the single digit 0, and if non-zero it will have an exponent unless that exponent would be 0. The exponent must fit in nine digits both before and after it is expressed in scientific notation.
Any digits in the parameter must be decimal; that is, Character.digit(c, 10)
(where c
is the character in question) would not return -1.
Java documentation for android.icu.math.BigDecimal.BigDecimal(java.lang.String)
.
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.
Applies to
BigDecimal(Int64)
Constructs a BigDecimal
object directly from a long
.
[Android.Runtime.Register(".ctor", "(J)V", "", ApiSince=24)]
public BigDecimal (long num);
[<Android.Runtime.Register(".ctor", "(J)V", "", ApiSince=24)>]
new Android.Icu.Math.BigDecimal : int64 -> Android.Icu.Math.BigDecimal
Parameters
- num
- Int64
The long
to be converted.
- Attributes
Remarks
Constructs a BigDecimal
object directly from a long
.
Constructs a BigDecimal
which is the exact decimal representation of the 64-bit signed binary integer parameter. The BigDecimal
will contain only decimal digits, prefixed with a leading minus sign (hyphen) if the parameter is negative. A leading zero will be present only if the parameter is zero.
Java documentation for android.icu.math.BigDecimal.BigDecimal(long)
.
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.
Applies to
BigDecimal(Char[], Int32, Int32)
Constructs a BigDecimal
object from an array of characters.
[Android.Runtime.Register(".ctor", "([CII)V", "", ApiSince=24)]
public BigDecimal (char[]? inchars, int offset, int length);
[<Android.Runtime.Register(".ctor", "([CII)V", "", ApiSince=24)>]
new Android.Icu.Math.BigDecimal : char[] * int * int -> Android.Icu.Math.BigDecimal
Parameters
- inchars
- Char[]
The char[]
array containing the number to be converted.
- offset
- Int32
The int
offset into the array of the start of the number to be converted.
- length
- Int32
The int
length of the number.
- Attributes
Remarks
Constructs a BigDecimal
object from an array of characters.
Constructs a BigDecimal
as though a String
had been constructed from the character array (or a subarray of that array) and the #BigDecimal(java.lang.String)
constructor had then been used. The first parameter must not be null
, and the subarray must be wholly contained within it.
Using this constructor is faster than using the BigDecimal(String)
constructor if the string is already available within a character array.
Java documentation for android.icu.math.BigDecimal.BigDecimal(char[], int, int)
.
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.
Applies to
BigDecimal(Double)
Constructs a BigDecimal
object directly from a double
.
[Android.Runtime.Register(".ctor", "(D)V", "", ApiSince=24)]
public BigDecimal (double num);
[<Android.Runtime.Register(".ctor", "(D)V", "", ApiSince=24)>]
new Android.Icu.Math.BigDecimal : double -> Android.Icu.Math.BigDecimal
Parameters
- num
- Double
The double
to be converted.
- Attributes
Remarks
Constructs a BigDecimal
object directly from a double
.
Constructs a BigDecimal
which is the exact decimal representation of the 64-bit signed binary floating point parameter.
Note that this constructor it an exact conversion; it does not give the same result as converting num
to a String
using the Double.toString()
method and then using the #BigDecimal(java.lang.String)
constructor. To get that result, use the static #valueOf(double)
method to construct a BigDecimal
from a double
.
Java documentation for android.icu.math.BigDecimal.BigDecimal(double)
.
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.
Applies to
BigDecimal(Char[])
Constructs a BigDecimal
object from an array of characters.
[Android.Runtime.Register(".ctor", "([C)V", "", ApiSince=24)]
public BigDecimal (char[]? inchars);
[<Android.Runtime.Register(".ctor", "([C)V", "", ApiSince=24)>]
new Android.Icu.Math.BigDecimal : char[] -> Android.Icu.Math.BigDecimal
Parameters
- inchars
- Char[]
The char[]
array containing the number to be converted.
- Attributes
Remarks
Constructs a BigDecimal
object from an array of characters.
Constructs a BigDecimal
as though a String
had been constructed from the character array and the #BigDecimal(java.lang.String)
constructor had then been used. The parameter must not be null
.
Using this constructor is faster than using the BigDecimal(String)
constructor if the string is already available in character array form.
Java documentation for android.icu.math.BigDecimal.BigDecimal(char[])
.
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.
Applies to
BigDecimal(BigInteger)
Constructs a BigDecimal
object from a BigInteger
, with scale 0.
[Android.Runtime.Register(".ctor", "(Ljava/math/BigInteger;)V", "", ApiSince=24)]
public BigDecimal (Java.Math.BigInteger? bi);
[<Android.Runtime.Register(".ctor", "(Ljava/math/BigInteger;)V", "", ApiSince=24)>]
new Android.Icu.Math.BigDecimal : Java.Math.BigInteger -> Android.Icu.Math.BigDecimal
Parameters
- bi
- BigInteger
The BigInteger
to be converted.
- Attributes
Remarks
Constructs a BigDecimal
object from a BigInteger
, with scale 0.
Constructs a BigDecimal
which is the exact decimal representation of the BigInteger
, with a scale of zero. The value of the BigDecimal
is identical to the value of the BigInteger
. The parameter must not be null
.
The BigDecimal
will contain only decimal digits, prefixed with a leading minus sign (hyphen) if the BigInteger
is negative. A leading zero will be present only if the BigInteger
is zero.
Java documentation for android.icu.math.BigDecimal.BigDecimal(java.math.BigInteger)
.
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.
Applies to
BigDecimal(Int32)
Constructs a BigDecimal
object directly from a int
.
[Android.Runtime.Register(".ctor", "(I)V", "", ApiSince=24)]
public BigDecimal (int num);
[<Android.Runtime.Register(".ctor", "(I)V", "", ApiSince=24)>]
new Android.Icu.Math.BigDecimal : int -> Android.Icu.Math.BigDecimal
Parameters
- num
- Int32
The int
to be converted.
- Attributes
Remarks
Constructs a BigDecimal
object directly from a int
.
Constructs a BigDecimal
which is the exact decimal representation of the 32-bit signed binary integer parameter. The BigDecimal
will contain only decimal digits, prefixed with a leading minus sign (hyphen) if the parameter is negative. A leading zero will be present only if the parameter is zero.
Java documentation for android.icu.math.BigDecimal.BigDecimal(int)
.
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.