Sign in to follow this  
Followers 0
zornaq

Decimal question

3 posts in this topic

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:

Share this post


Link to post
Share on other sites



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.

Share this post


Link to post
Share on other sites

Thanks dude! Keep up the great work!

:whistle:

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0