source: Include/com/currency.ab@ 193

Last change on this file since 193 was 192, checked in by イグトランス (egtra), 18 years ago

Currencyを追加、その他修正

File size: 1.6 KB
Line 
1' com/currency.ab
2
3Class Currency
4Public
5 Const Function Operator +() As Currency
6 Return New Currency(This)
7 End Function
8
9 Const Function Operator -() As Currency
10 Dim ret = New Currency
11 VarCyNeg(This.cy, ret.cy)
12 Return ret
13 End Function
14
15 Const Function Operator *(y As Currency) As Currency
16 Dim ret = New Currency
17 VarCyMul(This.cy, y.cy, ret.cy)
18 Return ret
19 End Function
20
21 Const Function Operator *(y As Long) As Currency
22 Dim ret = New Currency
23 VarCyMulI4(This.cy, y, ret.cy)
24 Return ret
25 End Function
26
27 Const Function Operator *(y As Int64) As Currency
28 Dim ret = New Currency
29 VarCyMulI8(This.cy, y, ret.cy)
30 Return ret
31 End Function
32
33 Const Function Operator /(y As Variant) As Double
34 Dim vx = New Variant(This)
35 Dim ret= vx / y
36 Return ret.ValR4
37 End Function
38
39 Const Function Operator /(y As Currency) As Double
40 Return This / New Varinat(y)
41 End Function
42
43 Const Function Operator +(y As Currency) As Currency
44 Dim ret = New Currency
45 VarCyAdd(This.cy, y.cy, ret.cy)
46 Return ret
47 End Function
48
49 Const Function Operator -(y As Currency) As Currency
50 Dim ret = New Currency
51 VarCySub(This.cy, y.cy, ret.cy)
52 Return ret
53 End Function
54
55 Const Function Abs() As Currency
56 VarCyAbs(This.cy, Abs.cy)
57 End Function
58
59 Const Function Fix() As Currency
60 VarCyFix(This.cy, Fix.cy)
61 End Function
62
63 Const Function Int() As Currency
64 VarCyInt(This.cy, Int.cy)
65 End Function
66
67 Const Function Round(c = 0 As Long) As Currency
68 VarCyRound(This.cy, c, Round.cy)
69 End Function
70Private
71 cy As CY
72End Class
Note: See TracBrowser for help on using the repository browser.