Portage complet PHP/Bash vers Node.js (Fastify + worker_threads)

This commit is contained in:
unfr
2026-04-23 08:37:48 +02:00
parent 2f7c990376
commit 3563de52e9
28 changed files with 3348 additions and 0 deletions

21
lib/format.js Normal file
View File

@@ -0,0 +1,21 @@
// Money formatting (Intl.NumberFormat replaces PHP's NumberFormatter::CURRENCY).
const FMT = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
maximumFractionDigits: 0,
minimumFractionDigits: 0,
});
export function formatCurrency(n) {
return FMT.format(n || 0);
}
export function pad2(n) {
return n < 10 ? `0${n}` : String(n);
}
export function formatRuntime(runtime) {
if (!runtime) return '';
return `${Math.floor(runtime / 60)} h ${pad2(runtime % 60)} min`;
}