> ## 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?)`

<Danger>
  This method has moved and is now part of the [JavaScript SDK](/js/introduction). To continue using this method, specify `includeSdk: true` when [initializing Smile UI](/ui/initializing).
</Danger>

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

## 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>
