On Friday 02 December 2005 07:09, Terry Simpson wrote:
> Yes. When you buy a bottle of shampoo it will probably have a code in EAN
> UCC format.

I haven't bought shampoo in years, and the barcodes I've seen encode the 
manufacturer on the left and the product on the right.

> EAN uses a 4 digit 'application identifier'. The first 3 digits specify the
> measure (e.g. width) plus a 4th digit specifies how many place to move the
> decimal point left.
>
>
>
> The application identifier for weight in kilograms is 3100. Weight in grams
> is 3103.

What's the code for megagrams? For picograms?

> The application identifier for length in metres is 3110. Length in mm is
> 3113.
>
> The 'applicable value' is coded in a 6 digit number. So a cable that is
> 3560.52 metres long would be coded as 3112 (= length in cm) 356052
>
> Other application identifiers (without the decimal digit) are:
>
> 310       Net weight         Kilograms
>
> 311       Length or first dimension Metres
>
> 312       Width, diameter, or second dimension      Metres
>
> 313       Depth, thickness, height, or third dimension          Metres

I don't need different codes for length and width, they're stored in different 
fields in the database. What's the code for kilograms per liter? Sieverts? 
Seconds? The program has one table consisting of densities of various 
materials.

How do you encode that when a length is to be output in inches, it is output 
in binary fractions?

A decimal code is not suitable for this application. The numbers are stored in 
8-byte IEEE floating point. The existing database has numbers stored as 
decimal character strings in fixed-width fields, and this has caused several 
data losses and allowed garbage to be entered in the database.

phma

Reply via email to