Table of Contents

Method GetDecimalPlaces

Namespace
WhalesSecret.TradeScriptLib.Utils.Math
Assembly
WhalesSecret.TradeScriptLib.dll

GetDecimalPlaces(decimal, bool)

Counts number of decimal places in a decimal number.

public static int GetDecimalPlaces(this decimal number, bool computeNegative)

Parameters

number decimal

Number whose number of decimal places to get.

computeNegative bool

If set to true and the number is greater than 0 and has no non-zero digits after the decimal point, the result can be negative. For example, we define the number of decimal places for 200.00 to be -2. If set to false, the minimum result value is 0.

Returns

int

Number of decimal places of the number.

Remarks