I am trying to convert a double value to Packed decimal COBOL format PIC S9(5)V9(4) COMP-3/Packed decimal COBOL format PIC S9(3)V9(4) COMP-3 format in JAVA, see below example :
Double Value : 00000.6775 Converted to Packed Decimal : ^@^FS,^@
Is this conversation possible in java?
Similar questions have been answered multiple times already on Stack overflow
For s9(5)V9(4) comp-3, 123.45 is represented in byte format as
The C is the sign
Yes this is possible, the JRecord package will do it (may truncate extra digits though).
The approach is
At this point there are several approaches