Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Change to DECIMALS ?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01165727
Message ID:
01166533
Views:
9
>The thing I have found is this...
>
>SET FIXED OFF and SET FIXED ON make no difference to this whatsoever.
>
>The help says this:
>ON
>Uses the SET DECIMALS setting to determine the number of decimal places displayed in results. The default number of decimal places is 2.
>OFF
>(Default) Allows the number of decimal places displayed in results to depend on the specific constants, variables, and operators used in a numeric expression. The contents of fields are displayed with the declared number of decimal places.
>
>I would have expected that with SET FIXED OFF, I would not get this:
>
>? VAL('1.615')
>1.62
>
>I am expecting 1.615 as the answer.
>
>Why do these things always go wrong when there are a million and one other things to fix?
>
>Simon

Just force them to take notice of what you want:
? ROUND( VAL( '1.615'), 3))

or, if '1.615' is in a char var:

? ROUND( VAL( lcNumber), 3)

Now has this worked? I keep repeating the func. but you don't say if the problem is gone :-)
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform