Class PayrollValue
Assembly: PayrollEngine.Client.Scripting.dll
Syntax
[JsonConverter(typeof(PayrollValueConverter))]
public class PayrollValue
Constructors
View Source
PayrollValue()
Declaration
View Source
PayrollValue(PayrollValue)
Declaration
public PayrollValue(PayrollValue source)
Parameters
| Type |
Name |
Description |
| PayrollValue |
source |
The source payroll value
|
View Source
PayrollValue(object)
Declaration
public PayrollValue(object value)
Parameters
| Type |
Name |
Description |
| object |
value |
The value
|
Fields
View Source
Empty
New payroll value instance
Declaration
public static readonly PayrollValue Empty
Field Value
Properties
View Source
CurrentValue
Declaration
protected virtual object CurrentValue { get; }
Property Value
View Source
HasValue
Test if the payroll value is defined
Declaration
[JsonIgnore]
public virtual bool HasValue { get; }
Property Value
View Source
IsNumeric
Test if the payroll value is numeric
Declaration
[JsonIgnore]
public bool IsNumeric { get; }
Property Value
View Source
Value
Declaration
public object Value { get; }
Property Value
Methods
View Source
Equals(object)
Determines whether the specified object is equal to this instance
Declaration
public override bool Equals(object obj)
Parameters
| Type |
Name |
Description |
| object |
obj |
The object to compare with the current object
|
Returns
| Type |
Description |
| bool |
True if the specified object is equal to this instance
|
Overrides
View Source
GetHashCode()
Returns a hash code for this instance
Declaration
public override int GetHashCode()
Returns
| Type |
Description |
| int |
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table
|
Overrides
View Source
Round(int, MidpointRounding)
Returns the integral digits of the specified decimal, using a step size
Declaration
public decimal? Round(int decimals = 0, MidpointRounding mode = MidpointRounding.ToEven)
Parameters
| Type |
Name |
Description |
| int |
decimals |
The number of significant decimal places (precision) in the return value
|
| MidpointRounding |
mode |
A value that specifies how to round d if it is midway between two other numbers
|
Returns
View Source
RoundDown(decimal)
Rounds a decimal value down
Declaration
public decimal RoundDown(decimal stepSize)
Parameters
| Type |
Name |
Description |
| decimal |
stepSize |
The round step size
|
Returns
| Type |
Description |
| decimal |
The down-rounded value
|
View Source
RoundUp(decimal)
Rounds a decimal value up
Declaration
public decimal RoundUp(decimal stepSize = 1)
Parameters
| Type |
Name |
Description |
| decimal |
stepSize |
The round step size
|
Returns
| Type |
Description |
| decimal |
The up-rounded value
|
View Source
ToString()
Returns a string that represents this instance
Declaration
public override string ToString()
Returns
| Type |
Description |
| string |
A string that represents this instance
|
Overrides
View Source
Truncate(int)
Returns the integral digits of the specified decimal, using a step size
Declaration
public decimal? Truncate(int stepSize = 1)
Parameters
| Type |
Name |
Description |
| int |
stepSize |
The step size used to truncate
|
Returns
Operators
View Source
operator +(PayrollValue, PayrollValue)
Addition of two payroll values (decimal, int, string)
Declaration
public static PayrollValue operator +(PayrollValue left, PayrollValue right)
Parameters
Returns
View Source
operator &(PayrollValue, PayrollValue)
Test if two payroll values are true (bool)
Declaration
public static PayrollValue operator &(PayrollValue left, PayrollValue right)
Parameters
Returns
View Source
operator |(PayrollValue, PayrollValue)
Test if any payroll value is true (bool)
Declaration
public static PayrollValue operator |(PayrollValue left, PayrollValue right)
Parameters
Returns
View Source
operator /(PayrollValue, PayrollValue)
Division of two payroll values (decimal, int)
Declaration
public static PayrollValue operator /(PayrollValue left, PayrollValue right)
Parameters
Returns
View Source
operator ==(PayrollValue, PayrollValue)
Compare two payroll values for equality
Declaration
public static bool operator ==(PayrollValue left, PayrollValue right)
Parameters
Returns
View Source
operator false(PayrollValue)
Test if payroll value is false
Declaration
public static bool operator false(PayrollValue value)
Parameters
Returns
View Source
operator >(PayrollValue, PayrollValue)
Compare if a payroll value is greater than another payroll value (decimal, int)
Declaration
public static PayrollValue operator >(PayrollValue left, PayrollValue right)
Parameters
Returns
View Source
operator >=(PayrollValue, PayrollValue)
Compare if a payroll value is greater or equals than another payroll value (decimal, int)
Declaration
public static PayrollValue operator >=(PayrollValue left, PayrollValue right)
Parameters
Returns
View Source
implicit operator bool(PayrollValue)
Convert payroll value to bool
Declaration
public static implicit operator bool(PayrollValue value)
Parameters
Returns
View Source
implicit operator DateTime(PayrollValue)
Convert payroll value to DateTime
Declaration
public static implicit operator DateTime(PayrollValue value)
Parameters
Returns
View Source
implicit operator decimal(PayrollValue)
Convert payroll value to decimal
Declaration
public static implicit operator decimal(PayrollValue value)
Parameters
Returns
View Source
implicit operator int(PayrollValue)
Convert payroll value to int/>
Declaration
public static implicit operator int(PayrollValue value)
Parameters
Returns
View Source
implicit operator bool?(PayrollValue)
Convert payroll value to nullable bool
Declaration
public static implicit operator bool?(PayrollValue value)
Parameters
Returns
View Source
implicit operator DateTime?(PayrollValue)
Convert payroll value to nullable DateTime
Declaration
public static implicit operator DateTime?(PayrollValue value)
Parameters
Returns
View Source
implicit operator decimal?(PayrollValue)
Convert payroll value to nullable decimal
Declaration
public static implicit operator decimal?(PayrollValue value)
Parameters
Returns
View Source
implicit operator int?(PayrollValue)
Convert payroll value to nullable int
Declaration
public static implicit operator int?(PayrollValue value)
Parameters
Returns
View Source
implicit operator string(PayrollValue)
Convert payroll value to string/>
Declaration
public static implicit operator string(PayrollValue value)
Parameters
Returns
View Source
operator !=(PayrollValue, PayrollValue)
Compare two payroll values for difference
Declaration
public static bool operator !=(PayrollValue left, PayrollValue right)
Parameters
Returns
View Source
operator <(PayrollValue, PayrollValue)
Compare if a payroll value is less than another payroll value (decimal, int)
Declaration
public static PayrollValue operator <(PayrollValue left, PayrollValue right)
Parameters
Returns
View Source
operator <=(PayrollValue, PayrollValue)
Compare if a payroll value is less or equals than another payroll value (decimal, int)
Declaration
public static PayrollValue operator <=(PayrollValue left, PayrollValue right)
Parameters
Returns
View Source
operator !(PayrollValue)
Logical negation of a payroll value (bool)
Declaration
public static PayrollValue operator !(PayrollValue value)
Parameters
Returns
View Source
operator %(PayrollValue, PayrollValue)
Remainder of two payroll values (decimal, int)
Declaration
public static PayrollValue operator %(PayrollValue left, PayrollValue right)
Parameters
Returns
View Source
operator *(PayrollValue, PayrollValue)
Multiplication of two payroll values (decimal, int)
Declaration
public static PayrollValue operator *(PayrollValue left, PayrollValue right)
Parameters
Returns
View Source
operator -(PayrollValue, PayrollValue)
Subtraction of two payroll values (decimal, int)
Declaration
public static PayrollValue operator -(PayrollValue left, PayrollValue right)
Parameters
Returns
View Source
operator true(PayrollValue)
Test if payroll value is true
Declaration
public static bool operator true(PayrollValue value)
Parameters
Returns
View Source
operator -(PayrollValue)
Unary minus of a payroll value (decimal, int)
Declaration
public static PayrollValue operator -(PayrollValue value)
Parameters
Returns
View Source
operator +(PayrollValue)
Unary plus of a payroll value (decimal, int)
Declaration
public static PayrollValue operator +(PayrollValue value)
Parameters
Returns
Extension Methods