Table of Contents


NxPrice Usage.

The struct NxPrice is a member of multiple structures in NxCoreAPI.

Read more about NxCore pricing concepts.

NxPrice

NxPrice is defined in NxCoreAPI.h as:


struct NxPrice {
    int           Price;
    unsigned char PriceType;
};

NxPrice members

Price

Price represents the price as an adjusted integer value. To convert the NxPrice object into a double, use PriceToDouble

PriceType

PriceType is a number between 0 and 39 which indicates how to convert between an implied decimal number and a floating point number. PriceTypes are arranged in 2 groups, one for base 10 (PriceType 0-19) and one for base 2 (PriceType 20-39). The table below shows the multiplication factor for each PriceType which will convert a integer price to a floating point number.

NxPriceType Factor NxPriceType Factor
0 Not defined 20 0.0009765625
1 0.000000001 21 0.001953125
2 0.00000001 22 0.00390625
3 0.0000001 23 0.0078125
4 0.000001 24 0.015625
5 0.00001 25 0.03125
6 0.0001 26 0.0625
7 0.001 27 0.125
8 0.01 28 0.25
9 0.1 29 0.50
10 1.0 30 1.0
11 10.0 31 2.0
12 100.0 32 4.0
13 1000.0 33 8.0
14 10000.0 34 16.0
15 100000.0 35 32.0
16 1000000.0 36 64.0
17 10000000.0 37 128.0
18 100000000.0 38 256.0
19 1000000000.0 39 512.0