SnapdPrice

SnapdPrice — Pricing information

Functions

Properties

gdouble amount Read / Write / Construct Only
gchar * currency Read / Write / Construct Only

Types and Values

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”                   gdouble

Amount of price.

Flags: Read / Write / Construct Only

Allowed values: >= 0

Default value: 0


The “currency” property

  “currency”                 gchar *

Currency amount is in.

Flags: Read / Write / Construct Only

Default value: NULL