Back to Vendure

UseLocalFormat

docs/docs/reference/dashboard/hooks/use-local-format.mdx

3.6.3511 B
Original Source
<GenerationInfo sourceFile="packages/dashboard/src/lib/hooks/use-local-format.ts" sourceLine="27" packageName="@vendure/dashboard" />

This hook is used to format numbers and currencies using the configured language and locale of the dashboard app.

Example

ts
const {
         formatCurrency,
         formatNumber,
         formatDate,
         formatLanguageName,
         formatCurrencyName,
         toMajorUnits,
} = useLocalFormat();
ts
function useLocalFormat(): void