private static function countSignificativeDigits(Decimal $val, Decimal $abs) { return strlen($val->value) - ($abs->comp(DecimalConstants::One()) === -1 ? 2 : max($val->scale, 1)) - ($val->isNegative() ? 1 : 0); }