Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How does the Number Class compare with Currency data types?

class compare currency Data types
0
Posted

How does the Number Class compare with Currency data types?

0

Microsoft provides a data type called “CURRENCY” as part of its OLE (Object Linking & Embedding) technology. To use it in a C++ application, you need to use MFC, which provides a C++ class called COleCurrency. (In Visual Basic this number type is called VB Currency.) COleCurrency behaves like a 64-bit integer with automatic scaling to support 4 digits to the right of the decimal point. While this is a little more convenient than resorting to manual scaling of C++’s basic integer data type, it still suffers from a number of drawbacks: • it doesn’t allow more than 4 digits to the right of the decimal point • you can perform addition and subtraction, but no other arithmetic operations between 2 COleCurrency values • multiplication or division can only be done against perfect integers, not floating point or another COleCurrency • use of COleCurrency requires MFC, adding needless overhead and Windows-dependency The Base/1 Number Class has none of these limitations. It can be used just like

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123