PHP Class PayPal\Converter\FormatConverter

Afficher le fichier Open project: paypal/rest-api-sdk-php Class Usage Examples

Méthodes publiques

Méthode Description
format ( $value, $formatter ) : string Format the data based on the input formatter value
formatToNumber ( $value, integer $decimals = 2 ) : null | string Format the input data with decimal places
formatToPrice ( $value, null $currency = null ) : null | string Helper method to format price values with associated currency information.

Method Details

format() public static méthode

Format the data based on the input formatter value
public static format ( $value, $formatter ) : string
$value
$formatter
Résultat string

formatToNumber() public static méthode

Defaults to 2 decimal places
public static formatToNumber ( $value, integer $decimals = 2 ) : null | string
$value
$decimals integer
Résultat null | string

formatToPrice() public static méthode

It covers the cases where certain currencies does not accept decimal values. We will be adding any specific currency level rules as required here.
public static formatToPrice ( $value, null $currency = null ) : null | string
$value
$currency null
Résultat null | string