Нужно в него засунуть DECIMAL или REAL
Как сделать?
И что такое CURRENCY, типа
Код: Выделить всё
CURRENCY GROUP
Low LONG
Hi LONG
ENDСпасибо.
Модератор: Дед Пахом
Код: Выделить всё
CURRENCY GROUP
Low LONG
Hi LONG
ENDКод: Выделить всё
!MSDN:
!The COM CY and Visual Basic Currency type is a signed 64-bit integer in units of 1/10,000 (or 1/100 of a cent).
!The currency type can accurately represent dollars and cents values, so it's good for financial calculations.
!The range of the currency type is more than +/- 900 trillion, so it'll even cover calculations of the national debt, at least for the foreseeable future.
!CURRENCY EQUATE(REAL)
!CY EQUATE(CURRENCY)
Код: Выделить всё
!CY GROUP,TYPE
!Lo ULONG
!Hi LONG
! END
!CURRENCY EQUATE(CY)
Код: Выделить всё
cyVal.Lo=INT(pValue)*10000 + (pValue-INT(pValue))*10000
Код: Выделить всё
Currency GROUP,TYPE
Low ULONG
High ULONG
END
Real2Currency PROCEDURE(REAL Price, *Currency Result)
Cnt LONG
CODE
CLEAR(Result.Low)
CLEAR(Result.High)
LOOP Cnt = 64 TO 0 BY -1
IF Price >= 2^Cnt
IF Cnt >= 32
Result.High += 2^(Cnt-32)
ELSE
Result.Low += 2^Cnt
END
Price -= 2^Cnt
END
END
Код: Выделить всё
MESSAGE(1000000*10000)Код: Выделить всё
MESSAGE(1000000*10^4)