Skip to content

DecimalExtensions Class ​

Definition ​

Extensions for the Decimal datatype

  • Namespace: JASE.Extensions
  • Assembly: JASE.Primitives.dll

Methods ​

NameDescription
int GetDecimalPlaces(decimal value)Returns the number of significant decimal digits to the right of the decimal point, trimming any trailing zeros. Example: 1.2300m -> 2.
Type GetReducedType(decimal value, bool preferUnsigned = null)Analyzes decimal value and determines if it's type can be reduced
int GetScale(decimal value)Returns the stored scale (0–28) in the decimal representation. Note: this includes trailing zeros (e.g., 1.2300m => 4).
bool HasDecimalPlaces(decimal value)Returns true if the input value contains decimal place values
bool HasDecimalPlaces(decimal value, out int decimalPlaces)Returns true if the input value contains decimal place values