Summer.Batch.Extra.Utils.BigDecimalUtils Class Reference

Big Decimal Helper. More...

Static Public Member Functions

static decimal Create ()
 Create a BigDecimal. More...
 
static decimal Create (string val)
 Create a BigDecimal from the given string. More...
 
static decimal Create (double val)
 Create a BigDecimal from the given double. More...
 
static decimal Create (int val)
 Create a BigDecimal from the given int. More...
 
static decimal Create (long val)
 Create a BigDecimal from the given long. More...
 
static decimal Create (decimal val)
 Create a BigDecimal from the given decimal. More...
 
static string ToString (decimal?decimal1)
 ToString method. More...
 
static int CompareTo (decimal?decimal1, decimal?decimal2)
 Compare two BigDecimals. More...
 
static bool IsGreaterThan (decimal?decimal1, decimal?decimal2)
 Check if the first given BigDecimal is greater than the second. More...
 
static bool IsLowerThan (decimal?decimal1, decimal?decimal2)
 Check if the first given BigDecimal is lower than the second. More...
 
static decimal Abs (decimal?decimal1)
 Compute the absolute value of the given BigDecimal. More...
 
static decimal Add (decimal?decimal1, decimal?decimal2)
 Add two BigDecimals. More...
 
static decimal Subtract (decimal?decimal1, decimal?decimal2)
 Subtract two BigDecimals. More...
 
static decimal Multiply (decimal?decimal1, decimal?decimal2)
 Multiply two BigDecimals. More...
 
static decimal Divide (decimal?decimal1, decimal?decimal2, int scale)
 Divide two BigDecimals with the given scale. More...
 
static decimal Divide (decimal?decimal1, decimal?decimal2)
 Divide two BigDecimals. More...
 
static bool IsNullOrZeroValue (decimal?decimal1)
 Check if the given BigDecimal is zero or null. More...
 

Detailed Description

Big Decimal Helper.

Member Function Documentation

static decimal Summer.Batch.Extra.Utils.BigDecimalUtils.Abs ( decimal?  decimal1)
static

Compute the absolute value of the given BigDecimal.

Parameters
decimal1BigDecimal
Returns
the absolute value of parameter.
static decimal Summer.Batch.Extra.Utils.BigDecimalUtils.Add ( decimal?  decimal1,
decimal?  decimal2 
)
static

Add two BigDecimals.

Parameters
decimal1BigDecimal
decimal2BigDecimal
Returns
the sum of the two arguments, handling null (ex : 3 + null = 3).
static int Summer.Batch.Extra.Utils.BigDecimalUtils.CompareTo ( decimal?  decimal1,
decimal?  decimal2 
)
static

Compare two BigDecimals.

Parameters
decimal1BigDecimal
decimal2BigDecimal
Returns
the value 0 if decimal2 is numerically equal decimal1. a value less than 0 if this decimal1 is numerically less than decimal2; and a value greater than 0 if decimal1 is numerically greater than decimal2. Null in case of null argument(s).
static decimal Summer.Batch.Extra.Utils.BigDecimalUtils.Create ( )
static

Create a BigDecimal.

Returns
BigDecimal
static decimal Summer.Batch.Extra.Utils.BigDecimalUtils.Create ( string  val)
static

Create a BigDecimal from the given string.

Parameters
valstring
Returns
BigDecimal
static decimal Summer.Batch.Extra.Utils.BigDecimalUtils.Create ( double  val)
static

Create a BigDecimal from the given double.

Parameters
valdouble
Returns
BigDecimal
static decimal Summer.Batch.Extra.Utils.BigDecimalUtils.Create ( int  val)
static

Create a BigDecimal from the given int.

Parameters
valint
Returns
BigDecimal
static decimal Summer.Batch.Extra.Utils.BigDecimalUtils.Create ( long  val)
static

Create a BigDecimal from the given long.

Parameters
vallong
Returns
BigDecimal
static decimal Summer.Batch.Extra.Utils.BigDecimalUtils.Create ( decimal  val)
static

Create a BigDecimal from the given decimal.

Parameters
valBigInteger
Returns
BigDecimal
static decimal Summer.Batch.Extra.Utils.BigDecimalUtils.Divide ( decimal?  decimal1,
decimal?  decimal2,
int  scale 
)
static

Divide two BigDecimals with the given scale.

Parameters
decimal1BigDecimal
decimal2BigDecimal
scaleint
Returns
the division between decimal1 and decimal2, with specified scale, rounded up for .5 or more, down otherwise. Null in case of null argument.
static decimal Summer.Batch.Extra.Utils.BigDecimalUtils.Divide ( decimal?  decimal1,
decimal?  decimal2 
)
static

Divide two BigDecimals.

Parameters
decimal1BigDecimal
decimal2BigDecimal
Returns
the division between decimal1 and decimal2.
static bool Summer.Batch.Extra.Utils.BigDecimalUtils.IsGreaterThan ( decimal?  decimal1,
decimal?  decimal2 
)
static

Check if the first given BigDecimal is greater than the second.

Parameters
decimal1BigDecimal
decimal2BigDecimal
Returns
true if decimal1 is numerically greater than decimal2. Otherwise false.
static bool Summer.Batch.Extra.Utils.BigDecimalUtils.IsLowerThan ( decimal?  decimal1,
decimal?  decimal2 
)
static

Check if the first given BigDecimal is lower than the second.

Parameters
decimal1BigDecimal
decimal2BigDecimal
Returns
true if decimal1 is numerically lower than decimal2. Otherwise false.
static bool Summer.Batch.Extra.Utils.BigDecimalUtils.IsNullOrZeroValue ( decimal?  decimal1)
static

Check if the given BigDecimal is zero or null.

Parameters
decimal1BigDecimal
Returns
true if argument is null or argument == 0.

s

static decimal Summer.Batch.Extra.Utils.BigDecimalUtils.Multiply ( decimal?  decimal1,
decimal?  decimal2 
)
static

Multiply two BigDecimals.

Parameters
decimal1BigDecimal
decimal2BigDecimal
Returns
the product between decimal1 and decimal2. Null in case of null argument.
static decimal Summer.Batch.Extra.Utils.BigDecimalUtils.Subtract ( decimal?  decimal1,
decimal?  decimal2 
)
static

Subtract two BigDecimals.

Parameters
decimal1BigDecimal
decimal2BigDecimal
Returns
the difference between decimal1 and decimal2. Null in case of null argument(s).
static string Summer.Batch.Extra.Utils.BigDecimalUtils.ToString ( decimal?  decimal1)
static

ToString method.

Parameters
decimal1BigDecimal
Returns
string representation of argument. Empty string if null.

The documentation for this class was generated from the following file:
  • Summer.Batch.Extra/Utils/BigDecimalUtils.cs