Multiple Methods Rounding Tool

Learning and using alternative number rounding methods with Multiple Methods Rounding Tool

Number Rounding Tool

Why a rounding tool? Numeric rounding is simply the process of approximating a number removal of digits to a simpler value that is close to the original. Different methods exist primarily to handle the “tie-breaker” situation (when a number is exactly halfway between two potential results, like 1.5).

The Multiple Methods Rounding Tool (below) uses the powerful decimal.js library to offer a wide range of standard industry rounding modes, including those that specifically address how to handle ties. As such, whether you use this tool on this webpage or download the HTML an launch locally, you will still need internet access.

The tool asks you to set the Rounding Place (where the rounding occurs) and the Rounding Mode (how the tie is broken). [For rounding with tolerance ranges, see Dual-Dimension Tolerance Rounding Tool.]

Rounding Modes Supported

The tool supports nine modes. Modes 0 through 7 are standard, deterministic methods, and Mode 8 is unique for statistical purposes.

ModeNameSimple Explanation (Handling Ties)Example (Rounding 1.5 to nearest unit)
0Round UpRounds away from zero. If the number is positive, it goes up; if negative, it goes down.1.5 to 2.0, -1.5 to -2.0
1Round DownRounds towards zero (also called Truncate). Simply chops off the extra digits.1.5 to 1.0, -1.5 to -1.0
2Round CeilRounds towards positive infinity (always up or stays the same).1.5 to 2.0, -1.5 to -1.0
3Round FloorRounds towards negative infinity (always down or stays the same).1.5 to 1.0, -1.5 to -2.0
4Round Half UpStandard Commercial Rounding. Rounds to the nearest digit, and if it’s a tie (exactly half), it rounds away from zero.1.5 to 2.0, -1.5 to -2.0
5Round Half DownRounds to the nearest digit, and if it’s a tie (exactly half), it rounds towards zero.1.5 to 1.0, -1.5 to -1.0
6Round Half EvenBanker’s Rounding. Rounds to the nearest digit, and if it’s a tie, it rounds to the nearest even number (to reduce statistical bias).1.5 to 2.0, 2.5 to 2.0
7Round Half CeilRounds to the nearest digit, and if it’s a tie, it rounds towards positive infinity.1.5 to 2.0, -1.5 to -1.0
8StochasticZero-Bias Rounding. It randomly rounds up or down, weighted by the fractional part, to ensure the average of many roundings is statistically correct.1.5 to 2.0 (50% of the time), 1.5 to 1.0 (50% of the time)

Multiple Methods Rounding Tool

Note: The rounding place is specified by its 10^N exponent, covering every single place value from 10^9 down to 10^-9. This utility is based on online sources, particular assumptions and calculations. This utility should only be used as a general reference. Results should always be verified. No one is responsible for incorrect information generated by this utility. Use thereof is the sole responsibility of the user. Use at your own risk.

MultipleMethodsRounding.zip

Author: fcsuper

As a drafter, mechanical designer and CAD engineer, I've been in the mechanical design field since 1991. For the first 8 years of my career, I was an AutoCAD professional. I utilized AutoLISP and many other AutoCAD customization features to streamline drafting activities for 6+ drafters and designers. I authored several custom functions, one of which was published in the March 1997 issue of Cadalyst Magazine. Since 1998, I've been used SolidWorks non-stop. I've worked to utilize the SolidWorks' user environment to simplify drafting and design activities for 20+ engineers. I've created this website to provide current information about SolidWorks from a variety of contributors. More recently, I am now employed by Dassault Systemes as SOLIDWORKS Sr. Product Definition Manager to improve drawing, annotation and MBD related areas.

Leave a Reply

Your email address will not be published. Required fields are marked *