Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Rounding Question
Message
De
19/08/1997 15:59:57
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
17/08/1997 02:11:04
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00044419
Message ID:
00045637
Vues:
54
> > Also, take a look to SET DECIMALS. Basically, it's the same thing as your > rounding setting. > > Vlad I don't think so. The DECIMALS setting affects the default display only, i.e. if you write ? 23/77, with how many decimals will it be written. Still, if you write x=23/77, x has all the possible decimals it can have (some 15, I think). I'm wrong - it behaved like that in 2.x, 1.x and neolyth. It really works now, but not always - you better check it. I've tried several versions of assigning a value to a variable before and after setting decimals to something (looped 1 to 15 decimals) and... well, only sure thing is that you set the decimals in advance, before you start calculating. For example, x=0.1234567890123456789 Set Deci To 4 ? x prints 0.1234567890123456789, but For j=1 to 15 set decimals to j x=0.1234567890123456789 ? x endfor gives 0,123456789012346000 0,123456789012346000 0,123456789012346000 0,123456789012346000 0,123456789012346000 0,123456789012346000 ... etc. In the help it says that Set Decimals affects the results of calculations, i.e. arithmetics and aggregate functions (like sum ... for and the such), but it obviously doesn't check for constants. I've tried even to print ?x+0.00 but it invariably printed all the decimals, regardless of the setting. So, I'd stick to Round(), just in case.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform