Extract double in binary file

Pascal pascal.parent at free.fr
Thu Nov 27 10:07:58 CET 2003


pascal.parent at free.fr (Pascal) wrote in message news:<e567c03a.0311260616.205efca0 at posting.google.com>...
> Hello,
> 
> I've a binary file with data in it.
> This file come from an old ms dos application (multilog ~ 1980).
> In this application, a field is declared as a 'decimal' (999 999
> 999.99).
> I put 0.00 in the field and save the record to the file.
> When I look in the binary file (with python or an hex editor), the
> field is stored on 8 bytes: 00-00-00-00-00-00-7F-00.
> I try unpack from struct module but the result isn't good.
> 
> Can someone help me?
> 
> Thanks.

First, thanks for answers.

Some precisions:
0.00 > 00-00-00-00-00-00-7F-00
1.00 > 00-00-00-00-00-00-00-81
2.00 > 00-00-00-00-00-00-00-82
3.00 > 00-00-00-00-00-00-40-82
4.00 > 00-00-00-00-00-00-00-83

10.00 > 00-00-00-00-00-00-20-84
1000.00 > 00-00-00-00-00-00-7A-8A

1.11 > 14-AE-47-E1-7A-14-0E-81




More information about the Python-list mailing list