How do i convert a packed field within a c sharp program
Convert packed integer from AS400
I am connecting to an AS400 server from c sharp. When i try to convert a packed field i am losing connection to the server. I have no problems with char fields.
VulpesPosted Jul 4, 2013, 2:32 PM
http://publib.boulder.ibm.com/iseries/v5r2/ic2924/books/c0925083170.htm
I've come up with the following conversion method assuming you can retrieve the packed field as a byte array from the AS400 server.
As packed decimals can be up to 29 digits long, only .NET's decimal type is large enough to deal accurately with them and so the method returns a decimal rather than an int, long or double: