Jump to content

Recommended Posts

Posted

I'm trying to do the following:

$x=20

$y=1-$x/100

and the number I get should be decimal 0,8. All I get is 1. What is wrong? Do I need to use Float or something?

:iamstupid:

  • Administrators
Posted

Yeah, you need to force the numbers into float mode:

$x=20.0

$y=1.0-$x/100.0

Actually, I'm just in the middle of changing this anyway (literally hacking the code now :whistle: ) so it will work like you expected in your original code. Us developers easily forget that general scripters aren't always familiar with the integer/float differences.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...