Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

numberThousandsFormat #289

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions autoPlay.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -1694,16 +1694,20 @@
breadcrumbs.appendChild(element);
document.LevelsSkip = element;
}

function numberThousandsFormat(x){
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ".");
}

function updateLevelInfoTitle(level)
{
var exp_lvl = expectedLevel(level);
var rem_time = countdown(exp_lvl.remaining_time);
var lvl_skip = getLevelsSkipped();

document.ExpectedLevel.textContent = 'Level: ' + level + ', Expected Level: ' + exp_lvl.expected_level + ', Likely Level: ' + exp_lvl.likely_level;
document.ExpectedLevel.textContent = 'Level: ' + numberThousandsFormat(level) + ', Expected Level: ' + numberThousandsFormat(exp_lvl.expected_level) + ', Likely Level: ' + numberThousandsFormat(exp_lvl.likely_level);
document.RemainingTime.textContent = 'Remaining Time: ' + rem_time.hours + ' hours, ' + rem_time.minutes + ' minutes.';
document.LevelsSkip.textContent = 'Skipped ' + lvl_skip + ' levels in last 5s.';
document.LevelsSkip.textContent = 'Skipped ' + numberThousandsFormat(lvl_skip) + ' levels in last 5s.';
}

// Helpers to access player stats.
Expand Down