Форум программистов, компьютерный форум, киберфорум
C++ Builder
Войти
Регистрация
Восстановить пароль
Блоги Сообщество Поиск Заказать работу  
 
Рейтинг 4.94/18: Рейтинг темы: голосов - 18, средняя оценка - 4.94
 Аватар для taras atavin
4226 / 1796 / 211
Регистрация: 24.11.2009
Сообщений: 27,562

currency

23.10.2011, 07:51. Показов 3392. Ответов 1
Метки нет (Все метки)

Студворк — интернет-сервис помощи студентам
C++
1
currecy RoundToKop(currecy summ);
borland visual c++ enterprize 6.0 ругается, говорит
declaration sintax error
, а на
C++
1
currency R;
-
type name expected
. Как с этим бороться?
0
cpp_developer
Эксперт
20123 / 5690 / 1417
Регистрация: 09.04.2010
Сообщений: 22,546
Блог
23.10.2011, 07:51
Ответы с готовыми решениями:

Подскажите как присвоить полю типа currency "общая стоимость" = день (цифра) * "стоимость за сутки" (типа currency)
Подскажите как присвоить полю типа currency "общая стоимость" = день (цифра) * "стоимость за сутки" (типа currency) .

Currency
Выскакивает ошибка External: SIGFPE на 18 строке. h:=sqrt(sqr(r1)-sqr(a)); Подскажите, пожалуйста, в чем может быть проблема. ...

Работа с Currency
Здрасте всем давно здесь небыл. Появился такой вот вопрос,как зделать округление.Пишу invoice часть.Например есть Amount...

1
 Аватар для Maluda
1280 / 598 / 116
Регистрация: 18.08.2009
Сообщений: 832
23.10.2011, 09:52
Цитата Сообщение от taras atavin Посмотреть сообщение
Как с этим бороться?
Для начала написать правильно слово Currency, учитывая регистр.
Если не поможет, подключить файл SysCurr.h

C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
// -----------------------------------------------------------------------------------
// syscurr.h: Currency Wrapper
//
// $Rev: 27016 $
//
// Copyright(c) 1995-2010 Embarcadero Technologies, Inc.
// -----------------------------------------------------------------------------------
#if !defined(SYSCURR_H)  
#define SYSCURR_H
 
#if !defined(SystemHPP)
#error Do not include this file directly.  Include 'System.hpp'.
#endif
 
#if !defined(SYSMAC_H)
#include <sysmac.h>
#endif
#if !defined(DSTRING_H)
#include <dstring.h>
#endif
#if !defined(WSTRING_H)
#include <wstring.h>
#endif
 
#pragma option push -w-inl -w-lvc
 
namespace System
{
 
// Forward ref.
class RTL_DELPHIRETURN Currency;
 
// (See classcre.asm)
extern "C" __int64 __cdecl    _roundToInt64(long double);
extern "C" void    __fastcall __currMul(const System::Currency c1, System::Currency &c2);
 
  class RTL_DELPHIRETURN CurrencyBase
  {
  public:
    __int64 Val;
  };
 
  class RTL_DELPHIRETURN Currency : public CurrencyBase
  {
    friend Currency __fastcall operator +(int lhs, const Currency& rhs);
    friend Currency __fastcall operator -(int lhs, const Currency& rhs);
    friend Currency __fastcall operator *(int lhs, const Currency& rhs);
    friend Currency __fastcall operator /(int lhs, const Currency& rhs);
    friend Currency __fastcall operator +(double lhs, const Currency& rhs);
    friend Currency __fastcall operator -(double lhs, const Currency& rhs);
    friend Currency __fastcall operator *(double lhs, const Currency& rhs);
    friend Currency __fastcall operator /(double lhs, const Currency& rhs);
  public:
    __fastcall Currency()                        {Val = 0;}
    __fastcall Currency(double val)              {Val = _roundToInt64(10000 * val);}
    __fastcall Currency(int val)                 {Val = 10000*(__int64)val;}
    __fastcall Currency(const CurrencyBase& src) {Val = src.Val;}
    __fastcall Currency(const Currency& src)     {Val = src.Val;}
    __fastcall Currency(const System::String& src);
 
    Currency& __fastcall operator =(double rhs)
    {
    Val = _roundToInt64(10000 * rhs);
    return *this;
    }
    Currency& __fastcall operator =(int rhs)
    {Val = 10000*(__int64)rhs; return *this;}
    Currency& __fastcall operator =(const CurrencyBase& rhs)
    {Val=rhs.Val;return *this;}
    Currency& __fastcall operator =(const Currency& rhs)
    {Val = rhs.Val; return *this;}
 
    Currency& __fastcall operator +=(const Currency& rhs)
    {Val += rhs.Val; return *this;}
    Currency& __fastcall operator -=(const Currency& rhs)
    {Val -= rhs.Val; return *this;}
 
    Currency& __fastcall operator *=(const Currency& rhs)
    /* Following has overflow issues - See @__currMul in CLASSCRE.ASM
    {Val *= rhs.Val; Val /= 10000; return *this;}
    */
    { __currMul(rhs, *this); return *this; }
 
    Currency& __fastcall operator /=(const Currency& rhs)
    {Val *= 10000; Val /= rhs.Val; return *this;}
    Currency& __fastcall operator %=(int rhs)
    {Val %= 10000 * (__int64)rhs; return *this;}
 
    Currency& operator ++() {Val += 10000; return *this;}
    Currency operator ++(int) {Currency tmp(*this); Val += 10000; return tmp;}
    Currency& operator --() {Val -= 10000; return *this;}
    Currency operator --(int) {Currency tmp(*this); Val -= 10000; return tmp;}
 
    Currency __fastcall operator +(const Currency& rhs) const
    {Currency tmp(*this); return tmp += rhs;}
    Currency __fastcall operator -(const Currency& rhs) const
    {Currency tmp(*this); return tmp -= rhs;}
    Currency __fastcall operator *(const Currency& rhs) const
    {Currency tmp(*this); return tmp *= rhs;}
    Currency __fastcall operator /(const Currency& rhs) const
    {Currency tmp(*this); return tmp /= rhs;}
 
    Currency __fastcall operator +(int rhs) const
    {Currency tmp(*this); return tmp += Currency(rhs);}
    Currency __fastcall operator -(int rhs) const
    {Currency tmp(*this); return tmp -= Currency(rhs);}
    Currency __fastcall operator *(int rhs) const
    {Currency tmp(*this); return tmp *= Currency(rhs);}
    Currency __fastcall operator /(int rhs) const
    {Currency tmp(*this); return tmp /= Currency(rhs);}
    Currency __fastcall operator %(int rhs) const
    {return Currency(static_cast<int>(Val % (10000 * (__int64)rhs))) / 10000;}
 
    Currency __fastcall operator +(double rhs) const
    {Currency tmp(*this); return tmp += Currency(rhs);}
    Currency __fastcall operator -(double rhs) const
    {Currency tmp(*this); return tmp -= Currency(rhs);}
    Currency __fastcall operator *(double rhs) const
    {Currency tmp(*this); return tmp *= Currency(rhs);}
    Currency __fastcall operator /(double rhs) const
    {Currency tmp(*this); return tmp /= Currency(rhs);}
 
    Currency __fastcall operator -() const
    {Currency tmp(*this); tmp.Val = -(tmp.Val); return tmp;}
 
    Currency __fastcall operator !() const
    {Currency tmp(*this); tmp.Val = !(tmp.Val); return tmp;}
 
    // comparisons (Currency rhs)
    bool __fastcall operator ==(const Currency& rhs) const
    {return Val == rhs.Val;}
    bool __fastcall operator !=(const Currency& rhs) const
    {return Val != rhs.Val;}
    bool __fastcall operator >(const Currency& rhs) const
    {return Val > rhs.Val;}
    bool __fastcall operator <(const Currency& rhs) const
    {return Val < rhs.Val;}
    bool __fastcall operator >=(const Currency& rhs) const
    {return Val >= rhs.Val;}
    bool __fastcall operator <=(const Currency& rhs) const
    {return Val <= rhs.Val;}
 
    // comparisons (int rhs)
    bool __fastcall operator ==(int rhs) const
    {return Val == 10000 * (__int64)rhs;}
    bool __fastcall operator !=(int rhs) const
    {return Val != 10000 * (__int64)rhs;}
    bool __fastcall operator >(int rhs) const
    {return Val > 10000 * (__int64)rhs;}
    bool __fastcall operator <(int rhs) const
    {return Val < 10000 * (__int64)rhs;}
    bool __fastcall operator >=(int rhs) const
    {return Val >= 10000 * (__int64)rhs;}
    bool __fastcall operator <=(int rhs) const
    {return Val <= 10000 * (__int64)rhs;}
 
    // comparisons (double rhs)
    bool __fastcall operator ==(double rhs) const
    {return Val == _roundToInt64(10000 * (long double)rhs);}
    bool __fastcall operator !=(double rhs) const
    {return Val != _roundToInt64(10000 * (long double)rhs);}
    bool __fastcall operator >(double rhs) const
    {return Val > _roundToInt64(10000 * (long double)rhs);}
    bool __fastcall operator <(double rhs) const
    {return Val < _roundToInt64(10000 * (long double)rhs);}
    bool __fastcall operator >=(double rhs) const
    {return Val >= _roundToInt64(10000 * (long double)rhs);}
    bool __fastcall operator <=(double rhs) const
    {return Val <= _roundToInt64(10000 * (long double)rhs);}
 
    __fastcall operator double() const {return ((double)Val) / 10000;}
    __fastcall operator int() const    {return (int) (Val / 10000);}
    __fastcall operator System::String() const;
  };
 
  // Currency friends
  //
  inline Currency __fastcall operator +(int lhs, const Currency& rhs)
  {Currency tmp(lhs); return tmp += rhs;}
  inline Currency __fastcall operator -(int lhs, const Currency& rhs)
  {Currency tmp(lhs); return tmp -= rhs;}
  inline Currency __fastcall operator *(int lhs, const Currency& rhs)
  {Currency tmp(lhs); return tmp *= rhs;}
  inline Currency __fastcall operator /(int lhs, const Currency& rhs)
  {Currency tmp(lhs); return tmp /= rhs;}
  inline Currency __fastcall operator +(double lhs, const Currency& rhs)
  {Currency tmp(lhs); return tmp += rhs;}
  inline Currency __fastcall operator -(double lhs, const Currency& rhs)
  {Currency tmp(lhs); return tmp -= rhs;}
  inline Currency __fastcall operator *(double lhs, const Currency& rhs)
  {Currency tmp(lhs); return tmp *= rhs;}
  inline Currency __fastcall operator /(double lhs, const Currency& rhs)
  {Currency tmp(lhs); return tmp /= rhs;}
 
  // NOTE: Insertion/Extraction operators of VCL classes are only visible
  //       if VCL_IOSTREAM is defined.
  //
  #if defined(VCL_IOSTREAM)
  std::ostream& operator << (std::ostream& os, const Currency& arg);
  std::istream& operator >> (std::istream& is, Currency& arg);
  #endif
 
}
 
#pragma option pop
 
#endif
2
Надоела реклама? Зарегистрируйтесь и она исчезнет полностью.
raxper
Эксперт
30234 / 6612 / 1498
Регистрация: 28.12.2010
Сообщений: 21,154
Блог
23.10.2011, 09:52
Помогаю со студенческими работами здесь

Ошибка с типом данных Currency
Делаю программу в Visual Studio, пишу, например Dim A As Currency, при этом Currency подчеркнут красной волнистой линией. Если навожу, то...

Что не так с этим Currency
Делаю программу (показана на изображении 1). Почему у меня красным цветом тип данных Currency? И свойства Value нет, соответственно тоже...

Как поменять вид валюты в Currency
Как поменять вид валюты в Currency: Собственно вот: Нужно кроны. Грн это просто я дописал по ошибке убрать нет проблемы. Как р....

Создать абстрактный класс Currency (валюта)
Создать абстрактный класс Currency (валюта) для работы с денежными суммами .Определить виртуальные функции перевода в рубли и вывода на...

Virtuemart изменить язык кнопки Change Currency
Всем доброго времени суток! Пожалуйста, помогите разобраться, почему при изменине параметра value на сайте до сих пор отображается Change...


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
2
Ответ Создать тему
Новые блоги и статьи
Уведомление о неверно выбранном значении справочника
Maks 06.04.2026
Алгоритм из решения ниже реализован на примере нетипового документа "НарядПутевка", разработанного в конфигурации КА2. Задача: уведомлять пользователя, если в документе выбран неверный склад. . .
Установка Qt Creator для C и C++: ставим среду, CMake и MinGW без фреймворка Qt
8Observer8 05.04.2026
Среду разработки Qt Creator можно установить без фреймворка Qt. Есть отдельный репозиторий для этой среды: https:/ / github. com/ qt-creator/ qt-creator, где можно скачать установщик, на вкладке Releases:. . .
AkelPad-скрипты, структуры, и немного лирики..
testuser2 05.04.2026
Такая программа, как AkelPad существует уже давно, и также давно существуют скрипты под нее. Тем не менее, прога живет, периодически что-то не спеша дополняется, улучшается. Что меня в первую очередь. . .
Отображение реквизитов в документе по условию и контроль их заполнения
Maks 04.04.2026
Алгоритм из решения ниже реализован на примере нетипового документа "ПланированиеСпецтехники", разработанного в конфигурации КА2. Данный документ берёт данные из другого нетипового документа. . .
Фото всей Земли с борта корабля Orion миссии Artemis II
kumehtar 04.04.2026
Это первое подобное фото сделанное человеком за 50 лет. Снимок называют новым вариантом легендарной фотографии «The Blue Marble» 1972 года, сделанной с борта корабля «Аполлон-17». Новое фото. . .
Вывод диалогового окна перед закрытием, если документ не проведён
Maks 04.04.2026
Алгоритм из решения ниже реализован на примере нетипового документа "СписаниеМатериалов", разработанного в конфигурации КА2. Задача: реализовать программный контроль на предмет проведения документа. . .
Программный контроль заполнения реквизитов табличной части документа
Maks 02.04.2026
Алгоритм из решения ниже реализован на примере нетипового документа "СписаниеМатериалов", разработанного в конфигурации КА2. Задача: 1. Реализовать контроль заполнения реквизита. . .
wmic не является внутренней или внешней командой
Maks 02.04.2026
Решение: DISM / Online / Add-Capability / CapabilityName:WMIC~~~~ Отсюда: https:/ / winitpro. ru/ index. php/ 2025/ 02/ 14/ komanda-wmic-ne-naydena/
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2026, CyberForum.ru