Basically. I didn't want to grab it typograchically in case someone put in an odd value such as a half penny.
$bob =.295 for example. Rounding the product works. Thanks for helping me out.
You'll Laugh at me , but here goes. I am writing a converter for wizard gold :). I solved this by using round()
$bob represents US Dollars.
1 Galleon =17 Sickles=493 Knuts.
Assumes 1 penny=1 knut.
Code:
<?
$bob=.29;
$knuts =round($bob*100);
$sickles = ($knuts/29);
$knuts = ($knuts % 29)...
I figured it was something like that, but I tried using fmod and it made no difference. Is there a way to convert a number into an integer? I tried using floor(), but that didn't work either.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.