React Native Mantine › Typography
NumberFormatter
Format numbers with separators and affixes
Import: import { NumberFormatter } from 'react-native-mantine';
Usage
import { NumberFormatter } from 'react-native-mantine';
<NumberFormatter
prefix="$ "
value={1234567.89}
thousandSeparator
decimalScale={2}
/>
// Custom separators
<NumberFormatter
value={1234567.891}
thousandSeparator="."
decimalSeparator=","
suffix=" EUR"
/>
Props
| Prop | Type | Default | Description |
|---|---|---|---|
value | number | string | Value to format. Nothing is rendered if the value is empty or not a valid number | |
prefix | string | Prefix added before the formatted value (e.g., "quot;) | |
suffix | string | Suffix added after the formatted value (e.g., " USD") | |
thousandSeparator | string | boolean | Thousands separator, true for "," or any string (e.g., " ", ".") | |
decimalSeparator | string | "." | Decimal separator character |
decimalScale | number | Limits the number of digits after the decimal point | |
fixedDecimalScale | boolean | false | If true, zeros are added to match decimalScale |
allowNegative | boolean | true | Determines whether negative values are allowed |
style | TextStyle | Additional styles to apply to the rendered text |