cancel
Showing results for 
Search instead for 
Did you mean: 

Format integers

Former Member
0 Kudos

Hi guys,

I have a signed integer that comes like this -> (28.48-) the less sign it’s on the right side!!! There is any way in XI (with or without standard function of message mapping) that format this value with less sign in the left side? Ex. -28.48

Anyone has developed a function to do this?

Thanks in advance,

Ricardo.

Accepted Solutions (1)

Accepted Solutions (1)

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

you can try with standard

if yourinteger <b>endsWith </b> value -> - then:

1. replaceString to replace - for SPACE

2. add minus - (<b>concat</b>) to your integer at the beginning

if not do nothing

do you think you can try this?

Regards,

michal

Former Member
0 Kudos

Hi guys,

The number doesn’t have a fix length and the less sign not always comes…

So, I will do it like Michal said ;o)

Thanks for the ideas are very helpful! I had troubled that this issue it would only be possible with user defined function!!! I come from ABAP and I’m not a java developer… I didn’t have time yet to learn java… but I know it is essential to workaround issues like this one.

Thanks for all,

Ricardo.

Answers (1)

Answers (1)

Former Member
0 Kudos

Ricardo,

If it is a fixed length one i.e, if the length of the field is 7 and it comes as 042.23- then

field --> Substring(0..6) --> concat --> output

For Concat in the first input take a constant and put as -and for the second input you give the substring. But it is only a partial solution. if your number comes in this format only it works or else you have to try with what michal have told. Since I dont know your complete requirement I have given this partial solution.

---Satish