System.Currency.Create
C++
__fastcall Currency() {Val = 0;}
__fastcall Currency(int val) {Val = 10000*(__int64)val;}
__fastcall Currency(const CurrencyBase& src) {Val = src.Val;}
__fastcall Currency(const System::String& src);
__fastcall Currency(double val);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
constructor | public | syscurr.h | System | Currency |
Description
Creates an instance of a Currency object.
Use the Currency constructors to create Currency objects from pointers to other Currency objects, and also from numeric and string values. The Currency constructors initialize Val with the 64-bit signed integer form of the Currency object value.
When called with no parameters, the resulting object has a value of 0.
When called with a Currency object as the src
parameter, the resulting object is a copy of src
(the copy constructor).
When called with a CurrencyBase object as the src
parameter, the resulting object has the same value as the src
parameter.
When called with an string object as the src
parameter, the value of the resulting object is the parsed value of the string. The string must represent a numeric value within the range valid for the Currency object (-922337203685477.5808 to 922337203685477.5807).
When called with a double or integer variable as the val
parameter, the value of the resulting object is the value of the val
parameter.