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
numberdecimalNumber whose number of decimal places to get.
computeNegativeboolIf set to
trueand thenumberis greater than0and has no non-zero digits after the decimal point, the result can be negative. For example, we define the number of decimal places for200.00to be-2. If set tofalse, the minimum result value is0.
Returns
- int
Number of decimal places of the number.