on 01-09-2009 6:32 AM
Hi
Can any plz tell me How to convert trailing minus sign into the leading minus sign? I mean in PI the amount filed shows like 150.00- i want to convert that into -150.00.
Thanks
Govinda
its always better to check if the field contains the minus sign first before doing the manipulation;
additional if condition will help;
if(a.indexOf("-") > 0)
{
return ("-" + a.substring(0,a.indexOf("-")) );
}
else
{return a;}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shabarish,
The code works but what if the input is something like [ 10.000-] i.e. with some spaces before 10.000- and the output as per your code comes as [- 10.000]. How do we tackle such cases if there is inconsistency in data i.e. some values come as [ 10.000-] i.e. spaces before the number and some values as [12.000-].
The output of this will come as
[- 10.000]
[-12.000]
How to make it as
[-10.000]
[-12.000]
Regards,
Shaibayan
Govinda:
Hope you can assist me with the same issue you describe.
I also need to have the minus sign in front of amount ex: -200.00.
How did you do this?
I want to do this in a transformation rule.
Thanks for your time
Denny
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try using standard functions in graphical mapping
replaceString --> replace tailing - by constant (nothing)
concatenate constant - with the resultant string
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use the following UDF,
amount Field(Source)>UDF>Target Field
UDF Code:
return ("-" + a.substring(0,a.indexOf("-")) );
- Gujjeti.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
9 | |
9 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.