× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I have a number in a character parameter 7a ('0000128') and I want to use
%DEC() to convert that to a packed 7.2 field.  However, I get 128.00
instead.  The reference manual is not completely clear on the decimal point
requirements for a character string numeric.  

        "The decimal point is optional. It can be either a period or a
comma."

Is the decimal point optional in that it can be either a period or a comma
or is it optional completely, be a period or be a comma?

If %DEC() is treating my number as a whole number then I must say that I
have been highly disappointed in the new features added to V5.2 for %DEC(). 


We often pass numeric data between programs in character fields (no comment
please if you don't agree with this) and convert them back to numeric.  We
rarely include the decimal point since the only method to date was to use
MOVE to convert it back to numeric.

I would prefer to not have to do this just to use %DEC() if the decimal
point is required in order for %DEC() to format the value as 1.28.
/FREE
   CDSRTL = %DEC(%subst(PASSSUGRTL:1:5)+'.'+%subst(PASSSUGRTL:6:2):7:2);
/END-FREE


Thank you,
Matt Tyler
WinCo Foods, Inc
mattt@xxxxxxxxxxxxxx


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.