|
| |
Knowledgebase
>>ITEM : R01001
>>DATE: 07/30/97
>>TYPE: Information
>>TITLE: Btrieve floating point numbers
display incorrectly
>>PRODUCT(S):
RaSQL/B (all versions) for FoxPro
RaSQL/B (all versions) for Clipper
RaSQL/X (all versions) for FoxPro
RaSQL/X (all versions) for Clipper
>>PLATFORMS(S):
Btrieve (all versions)
>>SUMMARY: Floating point numbers displays
with incorrect number of decimal digits, or
apparently incorrect digits after decimal point.
>>MORE INFORMATION:
Floating point number is RaSQL/B are defined as
type NF (IEEE floating point) or NB (MS or
Basic floating point).
Floating point numbers do not have a predefined
number of positions after the decimal point for
display purposes. How they are displayed depends
on the associated PICTURE clause, or the current
SET DECIMALS if no picture is specified. If
necessary, numbers may be rounded for display
purposes. However, all digits are maintained
internally for calculation purposes.
>>RESOLUTION/FIX:
Specify a PICTURE clause whenever displaying
a floating point number. Alternatively, change SET
DECIMALS to display additional digits after the
decimal point.The default value of SET DECIMALS
is 2.
>> EXAMPLE
* assume nFloat is internally stored as 3.666660
* SET DECIMALS default is 2
@ 1,0 SAY nFloat
* displays as 3.67 due to rounding
@ 2,0 SAY nFloat PICTURE "9.999999"
* displayed as 3.666660
SET DECIMALS TO 6
@ 3,0 SAY nFloat
* displays as 3.666660
>>SEE ALSO:
>>COPYRIGHT 1997 Communication Horizons
All rights reserved worldwide.
No distribution without specific consent of publisher.

| | |
|