Merge pull request #26 from billylo1/show-formatted-number

Show nicely formatted text
This commit is contained in:
Evert Timberg 2021-09-26 21:28:47 -04:00 committed by GitHub
commit a6a6da125e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -7,7 +7,7 @@ import Link from 'next/link'
function Logo(): JSX.Element {
const { t } = useTranslation('common');
const passCount = usePassCount();
const displayPassCount = (passCount? ` - ${passCount.toLocaleString()} receipts processed to date!` : '');
const displayPassCount = (passCount? ` - ${passCount} receipts processed to date!` : '');
return (
<Link href="/">

View File

@ -15,7 +15,7 @@ function Page(props: PageProps): JSX.Element {
const { t } = useTranslation('common');
const passCount = usePassCount();
const displayPassCount = (passCount? ` - ${passCount.toLocaleString()} receipts processed to date!` : '');
const displayPassCount = (passCount? ` - ${passCount} receipts processed to date!` : '');
return (
<div className="md:w-2/3 xl:w-2/5 md:mx-auto flex flex-col min-h-screen justify-center px-5 py-12">

View File

@ -23,7 +23,7 @@ export default function usePassCount() {
let response = await fetch(request);
const counter = await response.text();
return Promise.resolve(counter);
return Promise.resolve(parseInt(counter, 10).toLocaleString());
} catch (e) {
console.error(e);