Function Utils::nonzeroDecimals

Function Documentation

int Utils::nonzeroDecimals(const double num, const int decimalBound = 6)

Given a number num and a bound decimalBound, counts the number of non-zero decimals up to decimalBound.

Parameters
  • num – The input number

  • decimalBound – The maximal bound on decimals to be counted

Returns

The number of non-zero decimals