SnapdPrice: snapd-glib Reference Manual

## SnapdPrice SnapdPrice — Pricing information |

## Functions

gdouble | snapd_price_get_amount ()
const gchar * | snapd_price_get_currency ()

## Properties

double | amount | Read / Write / Construct Only
char * | currency | Read / Write / Construct Only

## Types and Values

| SnapdPrice

## Object Hierarchy

        GObject
        ╰── SnapdPrice

## Includes

    #include <snapd-glib/snapd-glib.h>

## Description

A SnapdPrice represents an amount of money required to purchase a snap. Prices can be queried using `snapd_snap_get_prices()` and are used in `snapd_client_buy_sync()`.

## Functions

### snapd_price_get_amount ()

    gdouble
    snapd_price_get_amount (SnapdPrice *price);

Get the currency amount for this price, e.g. 0.99.

Return: a currency amount.

#### Parameters

price | a SnapdPrice. |

Since: 1.0

### snapd_price_get_currency ()

    const gchar *
    snapd_price_get_currency (SnapdPrice *price);

Get the currency this price is in, e.g. "NZD".

#### Parameters

price | a SnapdPrice. |

#### Returns

an ISO 4217 currency code.

Since: 1.0

## Types and Values

### SnapdPrice

    typedef struct _SnapdPrice SnapdPrice;

SnapdPrice contains pricing information.

Since: 1.0

## Property Details

### The `“amount”` property

      “amount”                   double

Amount of price.

Owner: SnapdPrice

Flags: Read / Write / Construct Only

Allowed values: >= 0

Default value: 0

### The `“currency”` property

      “currency”                 char *

Currency amount is in.

Owner: SnapdPrice

Flags: Read / Write / Construct Only

Default value: NULL