# Spot the bug - #166: Gamer Tag Tagger

**URL:** <https://forum.kirupa.com/t/spot-the-bug-166-gamer-tag-tagger/683586>\
**Category:** web dev\
**Created:** [October 6, 2026, 7:00am UTC](https://forum.kirupa.com/t/spot-the-bug-166-gamer-tag-tagger/683586 "2026-10-06T07:00:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ellen1979](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ellen1979/32/31260_2.png) [@Ellen1979](https://forum.kirupa.com/u/Ellen1979)\
**Post date:** [October 6, 2026, 7:00am UTC](https://forum.kirupa.com/t/spot-the-bug-166-gamer-tag-tagger/683586/1 "2026-10-06T07:00:09Z")

</div>

Why is this username padder producing weirdly short results?

```js
function padTag(tag, length = 8) {
  const cleanTag = tag.trimStart();
  return cleanTag.padStart(length - cleanTag.length, "~");
}

```

Reply with what is broken and how you would fix it.
