Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Program for getting denomination
Message
From
09/12/1998 01:00:32
Vinod Parwani
United Creations L.L.C.
Ad-Dulayl, Jordan
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00164962
Message ID:
00165419
Views:
41
>>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
>
Thanks for your reply... Actually I'll make it more clear,

We've around 400 labours in our company & I'm making a Payroll program, For eg. one labour's salary is say 356 Dirhams (Currency Used in UAE), so the program should return this :-

100x3=300
50x1=50
5x1=5
1x1=1 Total is 356

Same way the loop will scan all the 400 records and update a dbf or cursor for all the employees.

Finally I can take the total report and give it to bank (as we are paying salary by cash ), so they can arrange the amount accordingly...

Can you pls tell me if there is already a program made for this thing...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform