Decimal to Packed Decimal Conversion in C++

V

Ven

Hi,

I want to convert a decimal feild into a packed decimal
field in my C++ program. How can I do that ? Is there any functions in
C++ that can do that.

I am using g++ compiler to compile my C++ progrmas.

I appreciate your help.

Thanks,
Ven.
 
V

Victor Bazarov

Ven said:
I want to convert a decimal feild into a packed decimal
field in my C++ program. How can I do that ? Is there any functions
in C++ that can do that.

Functions? A whole library of them. I am sure you should be able to
use some of them to achieve your goal. A single function? No single
function for such conversion.
I am using g++ compiler to compile my C++ progrmas.

Doesn't matter here. If you want a compiler-specific answer, please
ask in the compiler-specific forum.

V
 
O

osmium

Ven said:
I want to convert a decimal feild into a packed decimal
field in my C++ program. How can I do that ? Is there any functions in
C++ that can do that.

The and and shift operators should be a big help in this. There is not
function in the standard library to do that, but you could probably find a
function on the net someplace. I think the time spent searching and
learning to use what you find and testing the results would be better
invested in "rolling your own". Note that BCD deals with unsigned numbers
that have a sign attached as a separate indicator of some sort.
 
V

Ven

Thanks, for your suggestions.

Ven.
The and and shift operators should be a big help in this. There is not
function in the standard library to do that, but you could probably find a
function on the net someplace. I think the time spent searching and
learning to use what you find and testing the results would be better
invested in "rolling your own". Note that BCD deals with unsigned numbers
that have a sign attached as a separate indicator of some sort.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,835
Latest member
KetoRushACVBuy

Latest Threads

Top