Jump to content
Server Maintenance This Week. ×

Rounding math to increments of 10


This topic is 4835 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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?

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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 by comment
Link to comment
Share on other sites

This topic is 4835 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.