Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Rounding
Message
 
À
21/10/1997 16:20:38
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00055770
Message ID:
00055870
Vues:
39
>>>>>>>>>>I have a program that calculates a bunch of dollar figures as well as many whole number counts. Somehow I need the dollar figures to always round down(ie. 98.768 = 98.76), and the whole number counts to round up(55.6 = 56). These calculations are spread throughout the many forms and pages that make up the application. I am hoping for some type of SET option.
>>>>>>>>>>
>>>>>>>>>>Shane
>>>>>>>>>
>>>>>>>>>SET FIXED TO 2
>>>>>>>>
>>>>>>>>OOPS...
>>>>>>>>
>>>>>>>>SET DECIMALS TO 2
>>>>>>>>SET FIXED ON
>>>>>>>
>>>>>>>OOPS again... FIXED rounds it up...sorry
>>>>>>
>>>>>>
>>>>>>One more...
>>>>>>
>>>>>>nDollars = 12.237
>>>>>>
>>>>>>nFixedDollars = (INT((nDollars)*100))/100
>>>>>>
>>>>>>nFixedDollars = 12.23
>>>>>>
>>>>>>I KNOW that works
>>>>>
>>>>>Yes it work, but Floor(nDollars) is easier ;)
>>>>
>>>>OK, I give up. What's the practical difference between floor() and int()?
>>>>
>>>>... where the hell is my user's manual anyway?? .....
>>>
>>>never mind.... negative numbers....
>>>
>>>... ever have one of those days?? I got a couple cylinders that are misfiring today.
>>
>>I think I found the moldy cheese....now if I could only find that box of Q-tips...
>
>And the award for most responses to himself goes to MATT MCDONNELL!!!!! :-)

I am afraid I am going to second that motion. Now... how does one build a better Matt? :-)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform