Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why to set decimals?
Message
De
15/02/2001 11:50:25
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00475552
Message ID:
00476343
Vues:
26
***Having worked with VFP using high precision numbers, and not noticing this behavior, and wondering why:
A form with a textbox. The format is "R" (read input mask) and the inputmask is 999.99999999.

? outputs the expected value inside a transform
TRANS( 102043557 / 100000000 ), returns 1.02043557

But when assigning the texbox value:
Form.TextBox.Value=102043557 / 100000000, the output is 1.02040000

The set decimal is the default 2. When decimals is bumped, the resolution is as expected. Also odd is the fact that at decimal 2, the decimal is four in the TextBox. Can I get the accuracy through the format and inputmask properties, or do I need to bump up set decimals?
Thanks***

Hi Terry, is nice to write you.

In fact you will need to use SET DECIMALS because when VFP does that kind of operation it look at this set for return the correct number of decimals. I f you a minor number than the accuracy you want, then VFP only round the number.

I hope this helps.

Melvin

PD: Oh let me remember you that the SET DECIMALS only affects to the current datasession and it will needs the SET FIXED ON. (Regards)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform