Welcome Guest | My Membership | Login

Show Me The Money!


Summary

For eons, MultiValue programmers have used the "MR2" and "MD2" conversions for formatting money values. While this conversion is perfect for converting a stored money amount to something human-readable — for those of us with a decimal currency, that is — there are a surprising number of developers unaware that this code can do much more.

Whether formatting a money, decimal, date, time, alphanumeric, or other type of value, all of the conversion features of the MultiValue platform are worthy of continued study. In UniData, conversion codes are documented with the ICONV(..) and OCONV(..) functions in the BASIC Reference, but with conversions being a crucial feature of dictionaries and the query language you may find more information about conversions just about anywhere in a documentation bundle.

Today let's take a brief glance at the "MR2" conversion code. Years ago it was explained to me that the "M" and "R" mean "mask" and "right justified" and the following "2" means "show two decimal places". While accurate, it missed a very important detail: There's a digit missing!

The "MR" conversion code — as well as its kissing cousin "MD" (Mask Decimal) and even "ML" (Mask Left) — can be followed by two separate number parameters. The first number is the number of decimals to show, and the second is the number of positions to scale (move) the decimal point. For example, a conversion of "MR2" is really an abbreviation of "MR22", which means to show two decimal points after scaling the decimal by two positions. Similarly "MD4" will show four decimal places after scaling the number by four decimal places. (In an OCONV the decimal moves to the left; in an ICONV the decimal moves to the right.)

Read More...

Social Media Login

Use your existing social media logins to access your Membership/Subscription information.

Existing Magazine/Newsletter Subscriber (Quick Access)

If you are an existing International Spectrum subscriber, but have not registered with the website, please enter the Reference Code found on the magazine or in the e-mails you receive from us.

Magazine Reference Code location

Spectrum Login

New Subscriber

If you currently do not receive the Magazine or other emails from International Spectrum, select the "Subscribe" button below to create an new membership account.


 

Find out more about the different between the FREE and a Professional Membership at:
Compare Account Options

 

# # #          # # #          # # #

 

Related Articles

  • From the Inside: March/April 2013

    Company: International Spectrum

    What does the Future Client/UI look like? What should you start considering now in your application design?

  • A Specification Specification

    We've all been exposed to project specs. Some barely cover the back of a napkin. Others could crush a small country. It's time to rethink our approach. Bennett talks about specifications, iterative collaboration, and the value of building a better umbrella.

  • Automated Testing Part 1

    Company: Brian Leach Consulting, ltd

    Testing. Everybody claims to do it, but few do it well. Throwing random input at a program to see what happens is not true testing. As for "regression testing"? Testing everything that has been tested before to PROVE the new changes haven't broken something? The mind boggles. The first part of this series starts to explore how the "main stream" (non-MultiValue) developers do it, and why MultiValue will always be considered archaic if we don't get on board.

  • BlueFinity's mv.NET - Current and Future

    Company: BlueFinity International

    In this article, David Cooper of BlueFinity International discusses BlueFinity's strategy to integrate MultiValue data with modern Microsoft platforms and technologies using mv.NET Solution Objects.

  • Business Tech: Negotiation

    Company: HDWP

    Every day, without even realizing it, we engage in multiple negotiations, whether it is between a manager and a vendor, a developer and their boss, or even between two coworkers. Unfortunately too often these "negotiations" start off as an argument for each side trying to browbeat the other into submission. This article explores a few of the ways to avoid confrontational issues and turn these conversations into true negotiations looking for a common good.


Return to top