Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Rounding to the Nearest Whole Number

Author
Message
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 27th Mar 2006 02:48
I know I've done this before, but i forgot how, and I know its incredibly easy, but i can't think of how to do it right now...how would you change a variable in decimal increments (.1, .953, etc.), but then output the nearest whole number? I want to decrease something (health) for a test, and i want it to display as a whole number, but if i decrease it 1, it decreases way to fast

Pirates of Port Royale
Live the life of a pirate.
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 27th Mar 2006 02:52


First try that, then try this:



Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 27th Mar 2006 03:17
lol, sorry, i dont like the search, whenever i use it, i never find what im looking for, and I'm either too specific or too broad . Thanks though .

Pirates of Port Royale
Live the life of a pirate.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 27th Mar 2006 12:44 Edited at: 27th Mar 2006 12:45
Not the answer to your problem, but have you seen the new commands in u6...

Quote: "CEIL() and FLOOR():

Rounds down to the nearest whole, or rounds up to the nearest whole.
"


Login to post a reply

Server time is: 2024-09-24 19:26:13
Your offset time is: 2024-09-24 19:26:13