Skip to main content
JavaScript
Smile.formatPoints(1);
// Returns "1 Point"

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

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

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.

This method has moved and is now part of the JavaScript SDK. To continue using this method, specify includeSdk: true when initializing Smile UI.
This method formats a given amount of points for presentational purposes using the loyalty program’s points currency name/label and localization preferences.

Parameters

pointsAmount
integer
required
An integer representing the amount of points to format.
options
object

Returns

This method returns a String.