# ECPrice

If you want to relay pricing data to the server, you instantiate `ECPrice`.  For example, when you purchase a title via `ec.purchaseTitle` on [ECommerceInterface](/wii-shop-channel/js/ec/ecommerceinterface.md), you're expected to present a price as a parameter.

## Constructor

ECPrice expects exactly two parameters for its single constructor: `amount`, and `currency`.

```javascript
var price = new ECPrice(amount, currency);
```

For example, let's assume you wish to instantiate a price representing 4.99 USD. Both the amount and the currency are strings.

```javascript
var price = new ECPrice('4.99', 'USD');
```

## Properties

| Property Name    | Discussion                                                                                                                                      |
| ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| `price.amount`   | The amount that this ECPrice object represents, as a string. It is not converted to a numerical type for usage.                                 |
| `price.currency` | The currency this ECPrice object represents, as a string. There is no defined list of currencies checked against, so any value may be utilized. |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.oscwii.org/wii-shop-channel/js/ec/payment-objects/ecprice.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
