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"
This method formats a given amount of points for presentational purposes using the loyalty program’s points currency name/label and localization preferences.
This method requires points settings to be preloaded before use. Include pointsSettings in the preload array during initialization, or call Smile.preload() with pointsSettings before calling this method.

Parameters

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

Returns

This method returns a String.