All Content
Blogs
Forums
News
Tutorials
Log In
Sign Up
Login
Username / Email
Password
Remember me
Forgot password?
Login
or
Don't have a GameDev.net account?
Sign up
Forgot your password?
Email Address
Reset Password
Please contact us if you have any trouble resetting your password.
Home
Blogs
Forums
News
Portfolios
Projects
Tutorials
21
users logged in
New?
Learn about game development
.
Before posting, review our
community guidelines
.
Support GameDev.net with a monthly
GDNet+ subscription
!
Follow Us
Chat in the
GameDev.net Discord!
Back to General and Gameplay Programming
Advertisement
Rounding up/down
General and Gameplay Programming
Programming
Started by
Zombie
February 03, 2000 10:33 AM
0
comments, last by
Zombie
24 years, 10 months ago
Zombie
Author
122
February 03, 2000 10:33 AM
How can I round a number up/down to a nearest in one of these- 0,50,100,150,200,250,300 (in VB)?
Cancel
Save
SiCrane
11,840
February 03, 2000 11:01 AM
Assign the number to a float,
Divide by 50.
Add 0.5.
Assign to an Integer
Multiply by 50.
If greater than 300, set to 300.
If less than 0 set to 0.
Cancel
Save
This topic is closed to new replies.
Advertisement
Popular Topics
poker game
For Beginners
force opengl to use software rendering
Graphics and GPU Programming
Time to give up my engine?
Engines and Middleware
Cubemap Sampling Artifacts
Graphics and GPU Programming
Falloff
Math and Physics
Occluder from AABB, near plane 'fix'?
Graphics and GPU Programming
Advertisement
Recommended Tutorials
How to Analyze the Performance Cost of Your Unity Shaders
General and Gameplay Programming
GDC Online 2011
Event Coverage
How to write a 2D UFO game using the Orx Portable Game Engine - Part 5
General and Gameplay Programming
Making of an Arabic Teaching Game: Antura and The Letters
General and Gameplay Programming
How to Make an iMessage Game (and why)
Business and Law
Reticulating splines
About GameDev.net
Community Guidelines
Terms of Service
Privacy Policy
Contact Us
Copyright (c) 1999-2024 GameDev.net, LLC
Back to Top