Reputation: 1308
I have these numbers from an old database file and I'm looking for the numeric representation this uses.
The numbers are stored as binary format, and they're supposedly 64-bit floating numbers, something like: 54.123 and so on.
I'm posting only natural numbers because that's what I need and the field only contains natural numbers with no fractions.
These are some numbers I have:
00000000
10000100111000000
1000001001110000000
1100001110101000000
100000010011100000000
101000011000011000000
10000000111000100000
100100001011111100000
011100011000000
10000000101010011100000
Upvotes: 0
Views: 143
Reputation: 18633
Apparently, there are PHP classes for reading DBFs: http://www.phpclasses.org/package/1302-PHP-Extract-information-from-a-DBF-database-file.html . They say it doesn't need any extensions, it's all done with PHP functions.
Alternatively, you can inspect the DBF with various viewers to determine the format for that field.
According to this, there are several field types designed to store numbers. This talks about field types and how they're represented.
In any case, from what I understand, Numeric fields might be stored by default as ASCII, and I think are fixed length rather than floating point. So you might get away by using floatval
on them.
Upvotes: 1