# Formatting numbers

Sometimes, there may be lot of zeroes in a number. While displaying big numbers, it is often better to show the number as 1.2M or 25B. toLocaleString provides a neat way to do it.

```typescript
numberValue.toLocaleString('en-US', {
    minimumFractionDigits: 1,
    maximumFractionDigits: 3,
    notation: 'compact',
    compactDisplay: 'short'
  })
```

notation = compact shows K or M or B as suffix based on the number of digits. minimum and maximum fractional digits control how many decimal places are shown.  

| Number | Display |
| --- | --- |
| 25000000 | 25.0M |
| 2500000 | 2.5M |
| 2545400 | 2.545M |
| 2530000 | 2.53M |

Nice way to display large numbers!
