Opi
Opi

Reputation: 1308

What kind of binary numeric representation is this?

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:

Upvotes: 0

Views: 143

Answers (1)

Vlad
Vlad

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

Related Questions