[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[UDUNITS #MBR-454846]: udunits2: how to get numeric value


> I cannot for the life of me figure out how to get the actual (double
> precision?) *number* from a ut_unit struct.
> Where is this stored in ut_unit?  Can it be accessed by some function I'm
> missing?

The "ut_unit" type is deliberately opaque: only the UDUNITS-2 library knows its 
structure. Consider this: what "value" would you expect from the celsius unit? 
How about a logarithmic unit?

> Basically, I read a text file containing a bunch of numbers with different
> units, and I want to store the double precision values to my own data
> structure.

So, you want to convert a bunch of (value, unit) pairs into (value', unit') 
pairs? Is that right? If so, then you should be able to do that by first 
obtaining a converter between the input and output units and then converting 
the value.

> Kind Regards,
> --
> Aaron Webster

Steve Emmerson

Ticket Details
Ticket ID: MBR-454846
Department: Support UDUNITS
Priority: Normal
Status: Closed