ClassesBigCommerceCurrencyConfigurable Formatter

Configurable_Formatter

Class for configuring and formatting currency values.

Allows for customizable currency symbol, position, and decimal precision when formatting monetary values.

Methods

__construct

Constructor for Configurable_Formatter.

public __construct(string $symbol = '¤', string $symbol_position = Position::POSITION_LEFT, int $decimals = 2): mixed

Parameters:

ParameterTypeDescription
$symbolstringThe currency symbol to use (default is ’¤’).
$symbol_positionstringThe position of the currency symbol, using constants from Position (default is left).
$decimalsintThe number of decimal places for formatted values (default is 2).

format

Formats a currency value based on the configured settings.

public format(float $value): string

Parameters:

ParameterTypeDescription
$valuefloatThe numeric value to format.

Return Value:

The formatted currency value with the symbol in the configured position.



Automatically generated on 2025-01-21