> ## Documentation Index
> Fetch the complete documentation index at: https://dev.smile.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Format points

> `Smile.formatPoints(pointsAmount, options?)`

This method formats a given amount of points for presentational purposes using the loyalty program's points currency name/label and localization preferences.

> [!WARNING]
>
> This method requires points settings to be preloaded before use. Call [`Smile.preload()`](https://dev.smile.io/js/smile/preload) with `pointsSettings` before calling this method, or — if you initialize the JavaScript SDK yourself — include `pointsSettings` in the `preload` array during [initialization](https://dev.smile.io/js/smile/initialize.md).

## Parameters

**pointsAmount** `integer` *required*

An integer representing the amount of points to format.

**options** `object`

**properties**

**showPointsLabel** `boolean` (default: true)

A boolean value specifying whether the loyalty program's points label should be included in the returned string.

**pointsLabelPrefix** `string`

A string that will be included before the loyalty program's points label in the returned string.

## Returns

This method returns a `String`.

```javascript JavaScript lines theme={null}
Smile.formatPoints(1);
// Returns "1 Point"

Smile.formatPoints(
  2400,
  { showPointsLabel: false }
);
// Returns "2,400"

Smile.formatPoints(
  5000,
  { pointsLabelPrefix: 'Bonus ' }
);
// Returns "5,000 Bonus Points"
```
