Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. ressing1

    Modulus problem in PHP

    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.
  2. ressing1

    Modulus problem in PHP

    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)...
  3. ressing1

    Modulus problem in PHP

    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.
  4. ressing1

    Modulus problem in PHP

    Can anyone explain why this happens: <? $bill=(.29*100); $ted=29; print ($bill % 29)."<br>\n"; print ($ted % 29); ?> Result: 28 Incorrect 0 Correct

Part and Inventory Search

Back
Top