Files
outline/app/hooks/useFormatNumber.ts
codegen-sh[bot] b1dffc3486 Convert insights from sidebar to modal dialog (#9892)
* Convert insights from sidebar to modal dialog

- Remove insights routing and sidebar layout
- Update DocumentMeta to use modal action instead of navigation
- Convert Insights component to modal-ready format
- Clean up route helpers and authenticated layout
- Remove insights route from authenticated routes

Co-authored-by: Tom Moor <tom@getoutline.com>

* Applied automatic fixes

* refactor

* singular

* refactor

---------

Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
Co-authored-by: Tom Moor <tom@getoutline.com>
2025-08-11 18:57:27 -04:00

17 lines
484 B
TypeScript

import { formatNumber } from "~/utils/language";
import useUserLocale from "./useUserLocale";
import { unicodeCLDRtoBCP47 } from "@shared/utils/date";
/**
* Hook that returns a function to format numbers based on the user's locale.
*
* @returns A function that formats numbers
*/
export function useFormatNumber() {
const language = useUserLocale();
return (input: number) =>
language
? formatNumber(input, unicodeCLDRtoBCP47(language))
: input.toString();
}