Scott, the partner wants the data that way so that's how it has to be.
--- On Thu, 8/21/08, Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx> wrote:
From: Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx>
Subject: Re: Best way to convert numeric with Decimals
To: "RPG programming on the AS400 / iSeries" <rpg400-l@xxxxxxxxxxxx>
Date: Thursday, August 21, 2008, 7:48 PM
You can do this:
evalr char = %triml(%editc(number:'X'): '0');
Though, I can't for the life of me understand why you'd want to strip
out the decimal point. Now you're going to rely on the program that
receives the variable to assume a certain number of decimal points -- so
the number of decimal points has to be defined in two places, the one
who creates the parm, and the one who receives the parm.
Wouldn't it make more sense to leave the decimal point in the code so
the decimal places from the caller/callee don't have to match? Instead,
they calculate the number of decimals in the parm based on the position
of the decimal point? i.e. self-describing data.
It's also a lot easier for a human-being to read that way.
Adam West wrote:
HI I have a field that has to be sent over as character. It is numeric
with many prices as 19.99, etc.
I want to send it as character ' 19999' for 7 pos. field.
I am looking for the neatest way to do in RPG.