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.