Skip to content
العربية
Text

FormattedNumber

Numbers with Western digits in both languages; compact units in words in Arabic.

import { FormattedNumber, formatNumber } from "@percentsa/ui";

Examples

1,250,0001.3M42%
Code
export function FormattedNumberExample() {
  return (
    <Stack gap={2}>
      <FormattedNumber value={1250000} className="text-2xl" />
      <FormattedNumber value={1250000} options={{ notation: "compact" }} className="text-2xl" />
      <FormattedNumber value={0.42} options={{ style: "percent" }} className="text-2xl" />
    </Stack>
  );
}