× 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.



Jon Paris is correct. NUMVAL-C is generally used to convert values with
currency symbols, but I've used it before without them. It should work.
Where I've often been bit is that NUMVAL and NUMBAL-C both return a
floating point value. Floating point is not precise--at least not when
converted to a fixed-decimal value.

My only suggestion would be to define NUMFIELD as packed-decimal. You
could also try specifying an interim value using greater precision--at
time that helps when converting from floating point values.

I believe packed-decimal is COMP-3--I prefer specifying"PACKED-DECIMAL",
"BINARY", etc. so that no one is required to remember the esoteric
COMPUTATIONAL identifiers.

cobol400-l-bounces@xxxxxxxxxxxx wrote on 10/12/2013 01:00:09 PM:
----- Message from <geir.kildal@xxxxxxxxxx> on Sat, 12 Oct 2013 11:
47:21 +0300 -----

To:

<cobol400-l@xxxxxxxxxxxx>

Subject:

Re: [COBOL400-L] XML using COBOL(RPG)?

Hi.

I'm almost getting it working.

The generation of XML works fine.
The parsing works mostly fine.

However, I do have a problem with numeric values containing
decimals: '325.25' ends up like 325.00 in the receiving field when I
use
'compute NUMFIELD = function numval-c(XML-TEXT)'

NUMFIELD is pic 9(5)v99.

Am I using the wrong function? It works ok with numeric fields
without decimals.

Mvh. / Regards / Terveisin

Geir

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.