On Sat, 10 Oct 2015, Sven Schreiber wrote:
Am 10.10.2015 um 15:15 schrieb Raul Gimeno:
>
> I have imported data from Excel into Gretl.
>
> Numbers like 90454.8169 are displayed in Gretl without decimal places.
>
> When I go to display values and chose select data format with 4 decimal
> places the same numbers are displayed as in Excel.
>
> This format does not remain. When I display the data again the round
> numbers appear.
I can confirm that the format choice is not persistent (on Windows). Not
sure if that is by design or a bug.
I wouldn't say it's a bug: the option of examining a series in a
customized format was intended as an ad hoc thing.
To go back to the original question, Raul said, "Numbers like
90454.8169 are displayed in Gretl without decimal places."
I'm surprised if these are displayed with _no_ decimal places.
Here's a little test comma-separated file:
<csv>
x,y
90454.8169,1
90454.8269,2
90455.0,3
90454.8765,4
</csv>
and here's a little script to display the values:
<hansl>
open digits.csv
print --byobs
printf "%.4f\n", x
</hansl>
which produces the output:
<output>
? print --byobs
x y
1 90454.82 1
2 90454.83 2
3 90455.00 3
4 90454.88 4
1 90454.8169
2 90454.8269
3 90455.0000
4 90454.8765
</output>
Here the default printing of the series with the --byobs flag shows
2 decimal places for the x variable. The "printf" command also shows
how a series can be printed with a specific format: "%.4f" calls
for 4 decimal places.
By default gretl displays numerical values to a number of decimal
places (or significant digits) that reflects a tradeoff between
precision and avoidance of unncessary verbosity. You can always use
printf to look at numbers with any precision you like.
Internally, numerical values are always stored in "double precision"
(that is, using 64 bits, which corresponds to 15 or 16 significant
digits). You can print numbers to more than 16 digits but the tail
will just be noise. Besides, for actual socioeconomic data its
likely that anything beyond 5 or 6 digits is just noise. (Really
high precision physical measurements might yield data good to 9 or
10 digits.)
Allin Cottrell