# WHMCS\View\Formatter\Price

`Class`

Price Formatter.

## Constants

| Name | Description |
|  --- | --- |
| `PREFIX` |  |
| `PRICE` |  |
| `SUFFIX` |  |


## Methods

### __construct

```php
public function __construct($price, $currency = null)
```

Construct price object.

**Parameters**

| Type | Name | Description |
|  --- | --- | --- |
| `float` | `$price` |  |
| `Currency` | `$currency` |  |


### getValue

```php
public function getValue(): float
```

The underlying numeric value supporting the format.

**Returns** `float`

### __toString

```php
public function __toString()
```

Return the default price format with prefix and suffix.

**Returns** `string`

### toFull

```php
public function toFull()
```

Return price with prefix and suffix.

**Returns** `string`

### toPrefixed

```php
public function toPrefixed()
```

Return price with prefix only.

**Returns** `string`

### toSuffixed

```php
public function toSuffixed()
```

Return price with suffix only.

**Returns** `string`

### toNumeric

```php
public function toNumeric()
```

Return numeric price only.

**Returns** `string`

### format

```php
public function format($format = null, $currency = null)
```

Format a price in a given format.

**Parameters**

| Type | Name | Description |
|  --- | --- | --- |
| `string|null` | `$format` |  |
| `array|null` | `$currency` |  |


**Returns** `string`

### getCurrency

```php
public function getCurrency()
```

Return currency property.

**Returns** `Currency\|null`

### adjustDecimals

```php
public static function adjustDecimals($amount, $currencyCode)
```

Check the currency code and if it does not support decimal places, round the amount.

Some currencies do not have decimal places as standard.

**Parameters**

| Type | Name | Description |
|  --- | --- | --- |
| `T` | `$amount` |  |
| `string` | `$currencyCode` |  |


**Returns** `T\|int`

### isCycleDisabled

```php
public function isCycleDisabled(): bool
```