Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Program for getting denomination
Message
From
08/12/1998 08:10:56
 
 
To
08/12/1998 00:34:55
Vinod Parwani
United Creations L.L.C.
Ad-Dulayl, Jordan
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00164962
Message ID:
00165015
Views:
34
>Is there a program avl for getting denomination of given amount..
>
>Something like this...
>
>100X3=??
>50X1=??
>etc etc

I don't understand the terminology used here; normally, denomination refers to the unit of currency. VFP doesn't inherently know the available currency denominations. it also doesn't save results of currency in the units used to build the total; you could roll your own mechanism for this; it would probably be best implemented as a class of some sort.

The problem here is how VFP would know that a single number represented a variety of denominations; for example, using US currency, I could make the amount $20 as:

1 $20 bill or
2 $10 bills or
1 $10 bill + 1 $5 bill + 5 $1 bills

and the available units of currency change from country to country.

If you're looking for the magnitude of the result of a computation, the easiest thing to do is take the interger portion of the base 10 log; this is a simple thing to do in VFP: INT(LOG10(nExpression)) does exactly that.
? INT(LOG10(100*3))     && 2
? INT(LOG10(50*1))      && 1
? INT(LOG10(PI()*(3^2)) && 1
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform