Skip to content

Commit

Permalink
Use Intl.NumberFormat to format kilobytes
Browse files Browse the repository at this point in the history
  • Loading branch information
sixcorners committed Jan 15, 2025
1 parent b85ac51 commit 2fa2e7d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
const data = {
location: location,
repos: await toArrayPromise(ghRequest("https://api.github.com/users/sixcorners/repos")),
kbFormatter: new Intl.NumberFormat(undefined, {style: "unit", unit: "kilobyte"}),
};
createApp({data() { return data; }}).mount("body");
})();
Expand All @@ -80,7 +81,7 @@ <h1>Index of /</h1>
<td><a :href="repo.has_pages ? `https://${repo.owner.login}.github.io/${repo.name}/` : null">{{repo.name}}/</a>
<td>{{repo.created_at.replace(/T.*/, "")}}
<td>{{repo.updated_at.replace(/T.*/, "")}}
<td style="text-align: right">{{repo.size}}KB
<td style="text-align: right">{{kbFormatter.format(repo.size)}}
<td>{{repo.description}}
</template>
</table>
Expand Down

0 comments on commit 2fa2e7d

Please sign in to comment.