> ## 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. Include `pointsSettings` in the `preload` array during [initialization](/js/smile/initialize), or call [`Smile.preload()`](/js/smile/preload) with `pointsSettings` before calling this method.
</Warning>

## Parameters

<ParamField path="pointsAmount" type="integer" required>
  An integer representing the amount of points to format.
</ParamField>

<ParamField path="options" type="object">
  <Expandable title="properties">
    <ParamField path="showPointsLabel" type="boolean" default="true">
      A boolean value specifying whether the loyalty program's points label should be included in the returned string.
    </ParamField>

    <ParamField path="pointsLabelPrefix" type="string" default="">
      A string that will be included before the loyalty program's points label in the returned string.
    </ParamField>
  </Expandable>
</ParamField>

## Returns

This method returns a `String`.

<Panel>
  ```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"
  ```
</Panel>
