Format like in para #271

Open
paratoxic wants to merge 1 commit from format-like-para into master
Owner
No description provided.
Format like in para
All checks were successful
CI / test (pull_request) Successful in 4m20s
3bb2431f20
parabit approved these changes 2026-09-21 19:18:54 +00:00
parabit left a comment

LGTM

LGTM
@ -29,3 +29,3 @@
const formatPhd = (phd: number) => (phd < 1 ? formatHashDays(phd * 1e15) : `${trimPhd(phd)} PHd`);
const trimPhd = (phd: number) => String(Math.round(phd * 100) / 100);
const trimPhd = (phd: number) => String(Math.floor(phd * 100) / 100);
Owner

Shouldn't trimPhd be declared before formatPhd that uses it on line 29?

Also, if you are using this elsewhere, it would be a good idea to keep it in integer format instead of dividing back as most two digit decimals are not precise in u64.

Shouldn't trimPhd be declared before formatPhd that uses it on line 29? Also, if you are using this elsewhere, it would be a good idea to keep it in integer format instead of dividing back as most two digit decimals are not precise in u64.
@ -22,3 +11,1 @@
} else {
return `${scaledValue.toFixed(2)}${units[unitIndex]}`;
}
const truncated = Math.floor(scaledValue * 100) / 100;
Owner

trunc() instead of floor could be used throughout. It behaves identically in this context, but is better practice to use instead of floor() as it always tends towards 0.

No change needed.

trunc() instead of floor could be used throughout. It behaves identically in this context, but is better practice to use instead of floor() as it always tends towards 0. No change needed.
All checks were successful
CI / test (pull_request) Successful in 4m20s
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin format-like-para:format-like-para
git switch format-like-para

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch master
git merge --no-ff format-like-para
git switch format-like-para
git rebase master
git switch master
git merge --ff-only format-like-para
git switch format-like-para
git rebase master
git switch master
git merge --no-ff format-like-para
git switch master
git merge --squash format-like-para
git switch master
git merge --ff-only format-like-para
git switch master
git merge format-like-para
git push origin master
Sign in to join this conversation.
No description provided.