View Single Post
 
Reply
Posted 2004-08-23, 07:15 PM in reply to ograx's post starting "Nice work again Bluecube,both ways..."
ograx said:
---New question---
Is it possible to use numbers with decimal values in rpgmaker2003?
ie.(100x1.13)
This would be an example of a tax command for the economy.
So as price can also be controlled by separate tax rates.
The 100 represents the value of the variable which is hte price of the items you bought.

Nope. Do this:

(Make sure Tax is something like 106 (for 106%, obviously)

<> PriceAfterTax = OriginalTax
<> PriceAfterTax = Itself*OriginalPrice
<> PriceAfterTax = Itself/100

-----

Example Usage:

500 value, 6% tax. Tax would then be 106.

Tax = 106
Tax = 106 * 500 = 53000
Tax = 53000 / 100 = 530

-----

I believe that RPGMaker always rounds down when dealing with division. To fix this, you can simply add 50 before you divide by 100 - this will basically translate into an extra 0.5.

1.2 would round down normally, which is good. Adding 0.5 wouldn't change this (it would be 1.7, which still rounds down to 1).

1.6 would also round down, which is NOT good. Adding 0.5 fixes this (2.1 rounds down to 2)

Last edited by BlueCube; 2004-08-23 at 08:10 PM.
Old
Profile PM WWW Search
BlueCube enjoys the static noises of ten television sets simultaneously tuned to 412.84 MHzBlueCube enjoys the static noises of ten television sets simultaneously tuned to 412.84 MHz
 
 
BlueCube