Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Decimal rounding?
Message
 
 
À
22/06/1998 14:01:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00110613
Message ID:
00110697
Vues:
19
>I have a input form which captures numeric data (dollars, 2 decimal places). In the lostfocus event of each textbox I have it sum all the other text boxes and put the results into another text box called totaldollars. For some reason the total dollars textbox is getting rounded down a penny or so. All textboxes are bound to a table with numeric fields that have 2 decimal places. All text boxes have an inputmask of ##,###.## and a format of $. Any help would be appreciated.
>Thanks

This depends on what the 3rd decimal place digit is. What I do whin I can not allow rounding down is to add 0.0049 to the value before rounding. this guarantees rounding up to the nearest penny. If the initial value is 1.0000, the rounded result is 1.00. 1.0001 rounds to 1.01 after (adding the 0.0049.
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform