ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] where is the best place to do the calculation

From: Stig Bjørlykke <stig@xxxxxxxxxxxxx>
Date: Wed, 21 Jul 2010 17:06:14 +0200
On Wed, Jul 21, 2010 at 4:57 PM, Brian Oleksa
<oleksab@xxxxxxxxxxxxxxxxxxxxxx> wrote:
> Should latitude be a FT_FLOAT, FT_DOUBLE or what I have FT_UINT32. No
> matter what I try...I get the conversion from double to int possible
> loss of data error.

Use FT_DOUBLE and try something like this:

double latitude = tvb_get_ntohl (tvb, offset) / 1000000 - 90.0;
proto_tree_add_double(olsr_sub_tree, hf_olsr_latitude, tvb, offset, 4,
latitude);


-- 
Stig Bjørlykke