Update CalculateLuckyLevels.js (#1217)
* Update CalculateLuckyLevels.js Fixed infinite loop when currentLevel is too big * Update CalculateLuckyLevels.js Dev build * Update CalculateLuckyLevels.js Final build
This commit is contained in:
@@ -33,7 +33,7 @@ export function CalculateSevenDelta(number, digitPlace) {
|
||||
export default function CalculateLuckyLevels(currentLevel) {
|
||||
const result = {};
|
||||
let sevenCount = CountSevens(currentLevel);
|
||||
const numberOfDigits = String(currentLevel).length;
|
||||
const numberOfDigits = Math.max(Math.floor(Math.log10(Math.abs(currentLevel))), 0) + 1;
|
||||
|
||||
if (sevenCount >= 1) {
|
||||
result.luckyDigit = currentLevel;
|
||||
|
||||
Reference in New Issue
Block a user