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
25
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, 8 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
Relationship between resolution and polygon count
Graphics and GPU Programming
Texture Mapping Issue on Rendering Volumetric Clouds
Graphics and GPU Programming
blackjack
For Beginners
display text in sdl
For Beginners
Implementing the range-based for loop (aka foreach)
AngelCode
Support for template functions is now implemented in 2.38.0 WIP
AngelCode
Advertisement
Recommended Tutorials
Nine step recipe for good independent game design (Part II)
Game Design and Theory
Project Management
Production and Management
Tiles to Curves: Fun With Voronoi Graphs (part 1)
General and Gameplay Programming
How I Created My Single Threaded Event System
General and Gameplay Programming
Ramblings in Realtime: Chapter 1 - Inside Quake: Visible-Surface Determination
Graphics and GPU Programming
Reticulating splines
About GameDev.net
Community Guidelines
Terms of Service
Privacy Policy
Contact Us
Copyright (c) 1999-2024 GameDev.net, LLC
Back to Top