Jarvis Posted January 29, 2011 Posted January 29, 2011 I have a database for my cabinet shop that calculates dimensions. Cabinet box depth is a function how deep the countertops are, minus countertop overhang. Drawer box depth is a function of cabinet box depth minus 6 millimeters. If the cabinet box depth is 574mm then the drawer box depth is 568mm. I would like to always constrain drawer box depth to increments of 10mm with rounding always going to the next smallest increment of 10. For example: 568 mm would become 560mm 552 mm would become 550mm etc. How would I go about rounding the result so that it always expressed as an increment of 10?
Jarvis Posted January 31, 2011 Author Posted January 31, 2011 Thank you Vaughan for the tip about TRUNCATE Function. I was not aware of that one. What I am trying to do is not necessarily control how many digits are displayed but rather control the rounding in a very specific manner. I make use of the ROUND function all the time when converting imperial inches to millimeters. What I would like to do now is to always make the resulting number display in a unit of 10. For example: 562 is hard to find on a tablesaw vernier but 560 is easy. Tape rules tend to display units of 10. In a perfect world: 562 would always default to 560. 568 would default to 570. The significant part is that the resulting value be some decimal increment, i.e, ending with a (0). Any ideas how to do this kind of rounding?
comment Posted January 31, 2011 Posted January 31, 2011 (edited) 568 mm would become 560mm 552 mm would become 550mm Truncate ( n ; - 1 ) would do that. 562 would always default to 560. 568 would default to 570. Round ( n ; - 1 ) would do that. --- P.S. The Truncate() function does NOT "control how many digits are displayed" - it calculates a new number. Edited January 31, 2011 by comment
Jarvis Posted January 31, 2011 Author Posted January 31, 2011 Thanks guys! That is just what I needed. (don't know how it works but it sure seems to)
Recommended Posts
This topic is 5103 days old. Please don't post here. Open a new topic instead.
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 accountSign in
Already have an account? Sign in here.
Sign In Now