Subscribe to EDN
RSS
Reprints/License
Print
Email

Simplify computer-aided engineering with scientific-to-engineering conversion

Edited by Bill Travis

By Alexander Bell, Infosoft International, Rego Park, NY -- EDN, September 30, 2004

The simple yet useful formula in this Design Idea enables conversion from scientific format (for example,
2.2–9), which is typical for CAE (computer-aided-engineering), double-precision output values, into "human-friendly" engineering format (for example, 2.2 nF). The engineering format is more suitable for bills of material and other electrical and electronic-engineering documents and specifications.

The formula is rather straightforward. It takes two parameters. The first is the numerical value, and the second one specifies the unit of measurement—ohms, farads, or henries, for example. Alternatively, it could be of any random text, including an empty string, "." The formula calculates the mantissa/order of magnitude and returns the text string, formatted in compliance with commonly accepted electrical-engineering practice. Listing 1 shows details of the formula. The tricky part of the formula is the conversion to a decimal type after the formula calculates the ratio of two log values (Reference 1). This step ensures the correct order-of-magnitude calculations in cases in which the mantissa of the input value is close or equal to one.

The formula is in VB; you could use it in any VB/VBA-backed software applications. In this example, the function is in a code module of an MS Excel file (Figure 1). You could also use it as an Excel Add-In (.xla) or a "pure-VB," compiled-DLL component. Click here to download a zip file containing both Listing 1 and the Excel file. The input numerical value in this formula has double-precision accuracy, and its range spans from approximately –1.79308 to +1.79308, which is sufficient for any practical engineering calculations. Note that the maximum value is even bigger than the famous "googol," which is represented by 100 digits.


Reference
  1. Bell, Alexander, "What's wrong with INT(LOG) in VBA?" Access-VB-SQL Advisor, October 2002, pg 65.




Check out our Best of Design Ideas section!

RSS
Reprints/License
Print
Email
Canon Resource Center

Featured Company


Most Recent Resources

Advertisement
Related Content

No related content found.

  • 0 rated items found.
Advertisement

KNOWLEDGE CENTER

Datasheets.com Parts Search

185 million searchable parts
(please enter a part number or hit search to begin)
Engineering Careers
Jobs sponsored by
Advertisement
About EDN   |   Site Map   |   Contact Us   |   Subscription   |   RSS
© 2011 UBM Electronics. All rights reserved.
Use of this Web site is subject to its Terms of Use | Privacy Policy

Please visit these other UBM Canon sites

UBM Canon | Design News | Test & Measurement World | Packaging Digest | EDN | Qmed | Pharmalive | Appliance Magazine | Plastics Today | Powder Bulk Solids | Canon Trade Shows