site-panzai/utils/format.ts

13 lines
484 B
TypeScript
Raw Permalink Normal View History

2026-11-13 13:57:04 +01:00
export const eur = (cents: number | null | undefined) =>
cents == null ? '[PRIX]' : (cents / 100).toLocaleString('fr-FR', { minimumFractionDigits: 2, maximumFractionDigits: 2 }) + ' €'
export const hhmm = (t: number) =>
new Date(t).toLocaleTimeString('fr-FR', { hour: '2-digit', minute: '2-digit' }).replace(':', 'h')
export const payLabel: Record<string, string> = {
carte: 'Carte bancaire',
apple: 'Apple Pay',
google: 'Google Pay',
especes: 'Espèces au retrait'
}