Changeset 208 for Include/com/currency.ab
- Timestamp:
- Apr 7, 2007, 10:20:40 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Include/com/currency.ab
r200 r208 71 71 End Function 72 72 73 Static Function Compare(x As Currency, y As Currency) As HRESULT 74 Return VarCyCmp(x, y) 75 End Function 76 77 Static Function Compare(x As Currency, y As Double) As HRESULT 78 Return VarCyCmpR8(x, y) 79 End Function 80 81 Static Function Compare(x As Double, y As Currency) As HRESULT 82 Dim ret = VarCyCmpR8(y, x) 83 Select Case ret 84 Case VARCMP_LT 85 Return VARCMP_GT 86 Case VARCMP_GT 87 Return VARCMP_LT 88 Case Else 89 Return ret 90 End Select 91 End Function 92 93 Const Function Operator ==(y As Currency) As Boolean 94 Dim c = Compare(This, y) 95 Return c = VARCMP_EQ 96 End Function 97 98 Const Function Operator ==(y As Double) As Boolean 99 Dim c = Compare(This, y) 100 Return c = VARCMP_EQ 101 End Function 102 103 Const Function Operator <>(y As Currency) As Boolean 104 Dim c = Compare(This, y) 105 Return c <> VARCMP_EQ 106 End Function 107 108 Const Function Operator <>(y As Double) As Boolean 109 Dim c = Compare(This, y) 110 Return c <> VARCMP_EQ 111 End Function 112 113 Const Function Operator <(y As Currency) As Boolean 114 Dim c = Compare(This, y) 115 Return c = VARCMP_LT 116 End Function 117 118 Const Function Operator <(y As Double) As Boolean 119 Dim c = Compare(This, y) 120 Return c = VARCMP_LT 121 End Function 122 /* 123 Const Function Operator >(y As Currency) As Boolean 124 Dim c = Compare(This, y) 125 Return c = VARCMP_GT 126 End Function 127 128 Const Function Operator >(y As Double) As Boolean 129 Dim c = Compare(This, y) 130 Return c = VARCMP_GT 131 End Function 132 */ 133 Const Function Operator <=(y As Currency) As Boolean 134 Dim c = Compare(This, y) 135 Return result = VARCMP_LT Or result = VARCMP_EQ 136 End Function 137 138 Const Function Operator <=(y As Double) As Boolean 139 Dim c = Compare(This, y) 140 Return result = VARCMP_LT Or result = VARCMP_EQ 141 End Function 142 143 Const Function Operator >=(y As Currency) As Boolean 144 Dim c = Compare(This, y) 145 Return result = VARCMP_GT Or result = VARCMP_EQ 146 End Function 147 148 Const Function Operator >=(y As Double) As Boolean 149 Dim c = Compare(This, y) 150 Return result = VARCMP_GT Or result = VARCMP_EQ 151 End Function 152 73 153 Const Function Abs() As Currency 154 Abs = New Currency 74 155 VarCyAbs(This.cy, Abs.cy) 75 156 End Function 76 157 77 158 Const Function Fix() As Currency 159 Fix = New Currency 78 160 VarCyFix(This.cy, Fix.cy) 79 161 End Function 80 162 81 163 Const Function Int() As Currency 164 Int = New Currency 82 165 VarCyInt(This.cy, Int.cy) 83 166 End Function 84 167 85 168 Const Function Round(c = 0 As Long) As Currency 169 Round = New Currency 86 170 VarCyRound(This.cy, c, Round.cy) 87 171 End Function
Note:
See TracChangeset
for help on using the changeset viewer.