Currency Exchange Calculator (script): Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
No edit summary |
||
(7 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{Script |
{{Script |
||
|cat= |
|cat=information |
||
|fe=Genie |
|fe=Genie |
||
|auth=Isharon |
|auth=[[User:Isharon|Isharon]] |
||
}} |
}} |
||
This |
This script tells you how much money is needed to convert from one currency to another, including the exchange fee. (You may have a few extra coppers after the exchange, because the script always rounds up to the nearest whole number.) |
||
==Changelog== |
|||
'''06/12/2011''' |
|||
*Fixed bug that caused script to underestimate the amount needed. |
|||
==Syntax== |
==Syntax== |
||
Line 13: | Line 18: | ||
'''%fee''': the bank's exchange fee, expressed as a whole number<br> |
'''%fee''': the bank's exchange fee, expressed as a whole number<br> |
||
<br> |
<br> |
||
For example, let's say that you're in the Crossing, and you need |
For example, let's say that you're in the Crossing, and you need 4,500 Lirums. Your money is in Kronars, and the bank's exchange fee is 5%. You enter {{tt|.exch 4500 5}}. After starting the script, you see a menu that prompts you to select your starting currency, which is Kronars. The script then tells you that you need to withdraw 5,922 Kronars if you want 4,500 Lirums. |
||
==Script== |
==Script== |
||
⚫ | |||
<pre> |
|||
⚫ | |||
echo |
echo |
||
Line 38: | Line 42: | ||
Kronars: |
Kronars: |
||
Start = Final / Exchange / (1-Fee) |
|||
evalmath KROLIR ceiling(%1 * 1.25) |
|||
evalmath KROLIRFEE ceiling(%KROLIR*%RATE) |
|||
evalmath |
evalmath KROLIR ceiling(%1/.8/%FEE) |
||
evalmath KRODOK ceiling(%1 |
evalmath KRODOK ceiling(%1/.7216/%FEE) |
||
evalmath KRODOKFEE ceiling(%KRODOK*%RATE) |
|||
evalmath KRODOKTOT %KRODOK + %KRODOKFEE |
|||
echo |
echo |
||
echo Exchange fee used: %2% |
echo Exchange fee used: %2% |
||
echo |
echo |
||
echo Need %1 Lirums? Withdraw % |
echo Need %1 Lirums? Withdraw %KROLIR Kronars |
||
echo |
echo |
||
echo Need %1 Dokoras? Withdraw % |
echo Need %1 Dokoras? Withdraw %KRODOK Kronars |
||
echo |
echo |
||
goto end |
goto end |
||
Line 56: | Line 58: | ||
Lirums: |
Lirums: |
||
evalmath LIRKRO ceiling(%1 |
evalmath LIRKRO ceiling(%1/1.25/%FEE) |
||
evalmath |
evalmath LIRDOK ceiling(%1/.902/%FEE) |
||
evalmath LIRKROTOT %LIRKRO + %LIRKROFEE |
|||
evalmath LIRDOK ceiling(%1 * 1.108) |
|||
evalmath LIRDOKFEE ceiling(%LIRDOK*%RATE) |
|||
evalmath LIRDOKTOT %LIRDOK + %LIRDOKFEE |
|||
echo |
echo |
||
echo Exchange fee used: %2% |
echo Exchange fee used: %2% |
||
echo |
echo |
||
echo Need %1 Kronars? Withdraw % |
echo Need %1 Kronars? Withdraw %LIRKRO Lirums |
||
echo |
echo |
||
echo Need %1 Dokoras? Withdraw % |
echo Need %1 Dokoras? Withdraw %LIRDOK Lirums |
||
echo |
echo |
||
goto end |
goto end |
||
Line 74: | Line 72: | ||
Dokoras: |
Dokoras: |
||
evalmath DOKKRO ceiling(%1 |
evalmath DOKKRO ceiling(%1/(1/.7216)/%FEE) |
||
evalmath |
evalmath DOKLIR ceiling(%1/(1/.902)/%FEE) |
||
evalmath DOKKROTOT %DOKKRO + %DOKKROFEE |
|||
evalmath DOKLIR ceiling(%1 * .902) |
|||
evalmath DOKLIRFEE ceiling(%DOKLIR*%RATE) |
|||
evalmath DOKLIRTOT %DOKLIR + %DOKLIRFEE |
|||
echo |
echo |
||
echo Exchange fee used: %2% |
echo Exchange fee used: %2% |
||
echo |
echo |
||
echo Need %1 Kronars? Withdraw % |
echo Need %1 Kronars? Withdraw %DOKKRO Dokoras |
||
echo |
echo |
||
echo Need %1 Lirums? Withdraw % |
echo Need %1 Lirums? Withdraw %DOKLIR Dokoras |
||
echo |
echo |
||
goto end |
goto end |
||
end: |
end:</pre> |
||
</pre> |
Latest revision as of 01:11, 16 September 2015
Currency Exchange Calculator (script) | |
---|---|
Category | information |
Front-end | Genie |
Author | Isharon |
This script tells you how much money is needed to convert from one currency to another, including the exchange fee. (You may have a few extra coppers after the exchange, because the script always rounds up to the nearest whole number.)
Changelog
06/12/2011
- Fixed bug that caused script to underestimate the amount needed.
Syntax
.EXCH %AMOUNT %FEE
%amount: the desired amount of the currency you need
%fee: the bank's exchange fee, expressed as a whole number
For example, let's say that you're in the Crossing, and you need 4,500 Lirums. Your money is in Kronars, and the bank's exchange fee is 5%. You enter .EXCH 4500 5. After starting the script, you see a menu that prompts you to select your starting currency, which is Kronars. The script then tells you that you need to withdraw 5,922 Kronars if you want 4,500 Lirums.
Script
evalmath FEE 1 - %2/100 echo echo Starting Currency: echo echo 1: Kronars echo echo 2: Lirums echo echo 3: Dokoras echo echo Enter Number: matchre Kronars ^1 matchre Lirums ^2 matchre Dokoras ^3 matchwait Kronars: Start = Final / Exchange / (1-Fee) evalmath KROLIR ceiling(%1/.8/%FEE) evalmath KRODOK ceiling(%1/.7216/%FEE) echo echo Exchange fee used: %2% echo echo Need %1 Lirums? Withdraw %KROLIR Kronars echo echo Need %1 Dokoras? Withdraw %KRODOK Kronars echo goto end Lirums: evalmath LIRKRO ceiling(%1/1.25/%FEE) evalmath LIRDOK ceiling(%1/.902/%FEE) echo echo Exchange fee used: %2% echo echo Need %1 Kronars? Withdraw %LIRKRO Lirums echo echo Need %1 Dokoras? Withdraw %LIRDOK Lirums echo goto end Dokoras: evalmath DOKKRO ceiling(%1/(1/.7216)/%FEE) evalmath DOKLIR ceiling(%1/(1/.902)/%FEE) echo echo Exchange fee used: %2% echo echo Need %1 Kronars? Withdraw %DOKKRO Dokoras echo echo Need %1 Lirums? Withdraw %DOKLIR Dokoras echo goto end end: