>Hi, Hilmar!
>
>>>
>Wouldn't the REPLACE work with double, too?
><<
>
>I don't think so!
>
>The reason because it works with numeric field is: Numeric fields are stored in the DBF as characters (you can see this if you have a look in a DBF using a hex editor).
>Double is stored in an packed format - there is no way to make such tricks without violating the basic rules of storing doubles!
>
>My Conclusion: In your circumstances you can only deal with numeric!
OK, it is time I do some additional tests (I posted the question, because I thought there was a problem - see below - and because I thought that some people had solved it already).
Since I don't want to loose precision (significant digits, that is), I create a table Numeric N(10,0) and Double B(8,0).
replace Numeric with 1e-5
? Numeric
? Numeric * 1e6
replace Double with 1e-5
? Double
? Double * 1e6
Further tests: Even the import works as expected! I was fooled in the beginning, because of the display. It seems that "zero decimals" or "four decimals" only affects the
display of the data!
In summary:
Double seems to be the best choice in this case.
There is no real problem in saving data, but there may be confusion in displaying it.
Thanks for your feedback!
Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)