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



Rob,
See code below,
d $Amountu s 18 inz('111,111,111.11')

d $AmountE s 18 inz('111111111,11')

d $amtun s 18s 2

d $amten s 18s 2

****************************************************************

* Main Line Routine *

****************************************************************

/Free

$amtun = %dec(%xlate(',':' ':$amountu): 18: 2);
// gives $AMTUN = 0000000111111111.11

//

$amten = %dec(%xlate(',':' ':$amounte): 18: 2);
// gives $AMTEN = 0000011111111111.00

//

*inlr = *on;

//

Return;

//

/End-Free

%xlate is not working for European decimal with %dec.

Just a thought.


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of rob@xxxxxxxxx
Sent: Tuesday, December 30, 2008 12:14 PM
To: RPG programming on the IBM i / System i
Subject: Re: Converting a string to a number in RPG

Wayne,

If I did that then instead of one million two hundred thirty four
thousand
five hundred sixty seven and 89/xx
I would have gotten
one hundred twenty three million four hundred fifty six thousand seven
hundred eighty nine and xx/xx.

Use %xlate to replace the commas with spaces. %dec is forgiving of
spaces.

rob@xxxxxxxxx wrote:
So, in a multilingual application how would one convert all these?
"1234567,89" European comma decimal point

Rob Berendt

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.