Hello, thanks for visiting GameML, if you are a Game Maker user, this is the site for you, please sign up, or login if you are already a member, or just browse the site! Welcome to GameML!

ATTENTION MEMBERS!!! USERS CAN NOW SIGN UP AGAIN!

Join the forum, it's quick and easy

Hello, thanks for visiting GameML, if you are a Game Maker user, this is the site for you, please sign up, or login if you are already a member, or just browse the site! Welcome to GameML!

ATTENTION MEMBERS!!! USERS CAN NOW SIGN UP AGAIN!
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Log in

I forgot my password

Search
 
 

Display results as :
 


Rechercher Advanced Search

Site Hits
Free hit counter
These stats started at 0 on July 7th 2009
GameML File Sharing
USERNAME: gamemladmin@gmail.com PASSWORD: gamemlsite Upload Here: https://gameml.forumotion.com/GameML-File-Sharing-h3.htmPlease add only games.
Create A GAMEML BLOG!
Make a Blog on GameML:http://gamemlblogs.wetpaint.com

Rounding variables??

3 posters

Go down

Rounding variables?? Empty Rounding variables??

Post by The Puppet Master Thu Jun 25, 2009 5:24 pm

How do I round a variable?

Like if a variable is 1.2 how do I round that to 1?
The Puppet Master
The Puppet Master
Game5L
Game5L

Posts : 471
Points : 55071
GameML Reputation : 4
Join date : 2009-06-03
Age : 29
Location : Valhalla

Back to top Go down

Rounding variables?? Empty Re: Rounding variables??

Post by CarnivorousA Thu Jun 25, 2009 5:26 pm

I suppose you could try something like
if variable is less than 1.5 then
variable = 1
if variable is more than 1.5 then
variable = 2
etc.

Probably not the best choice but whatever.
CarnivorousA
CarnivorousA
Moderator
Moderator

Posts : 1402
Points : 56492
GameML Reputation : 17
Join date : 2009-06-01
Age : 29
Location : At the bottom of the lake.

http://entertainmypeople.freeforums.org/index.php

Back to top Go down

Rounding variables?? Empty Re: Rounding variables??

Post by The Puppet Master Thu Jun 25, 2009 5:37 pm

I want the variable to change though, and every time it changes it gets rounded
The Puppet Master
The Puppet Master
Game5L
Game5L

Posts : 471
Points : 55071
GameML Reputation : 4
Join date : 2009-06-03
Age : 29
Location : Valhalla

Back to top Go down

Rounding variables?? Empty Re: Rounding variables??

Post by Hepolite Fri Jun 26, 2009 2:18 am

floor(x) Rounds down
round(x) Rounds to closes whole number
ceil(x) Round up
Hepolite
Hepolite
GameML Noob
GameML Noob

Posts : 23
Points : 54587
GameML Reputation : 12
Join date : 2009-06-03
Age : 31
Location : Land far, far away from the land far, far awaay

Back to top Go down

Rounding variables?? Empty Re: Rounding variables??

Post by CarnivorousA Fri Jun 26, 2009 5:12 am

Yeah listen to him he knows what he's doing.
CarnivorousA
CarnivorousA
Moderator
Moderator

Posts : 1402
Points : 56492
GameML Reputation : 17
Join date : 2009-06-01
Age : 29
Location : At the bottom of the lake.

http://entertainmypeople.freeforums.org/index.php

Back to top Go down

Rounding variables?? Empty Re: Rounding variables??

Post by The Puppet Master Fri Jun 26, 2009 1:31 pm

ok thanks
The Puppet Master
The Puppet Master
Game5L
Game5L

Posts : 471
Points : 55071
GameML Reputation : 4
Join date : 2009-06-03
Age : 29
Location : Valhalla

Back to top Go down

Rounding variables?? Empty Re: Rounding variables??

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum