cancel
Showing results for 
Search instead for 
Did you mean: 

X-Path function for rounding to nearest decimal

Former Member
0 Kudos

Hi All,

We are having a requirement where we are having a field which holds a decimal value. So, we need to round it to nearest decimal and then we need to compare it with "0.000".

We need to implement this condition in Standard Receiver Determination..

So i need X-Path function for rounding to nearest decimal.

If anyone can provide any info regarding this would really help..

Thanks,

Sudha

Accepted Solutions (0)

Answers (2)

Answers (2)

MichalKrawczyk
Active Contributor
0 Kudos

hi,

if you won't find any standard fuction for that

you can do it in java easily:

1. create an adapter module that will check the condition and

will be filling some custom ASMA

2. then in receiver det you can check this ASMA

this way only java limits you and not the xpath

Regards,

Michal Krawczyk

Former Member
0 Kudos

hi sudha there is a standard function formatnum use that in a particular way lik #####.00 formats to two decimal places.

###.0000 to four decimal places...

and in your case i guess u can place it in ###.0 format and try comparing...

Edited by: ROBIN C on Nov 19, 2008 5:28 PM

Edited by: ROBIN C on Nov 19, 2008 5:29 PM

bhavesh_kantilal
Active Contributor
0 Kudos

Check the numeric functions to see if they satisfy your need.

http://www.w3schools.com/Xpath/xpath_functions.asp#numeric

Can you give a example of what you need?

Regards

Bhavesh

Former Member
0 Kudos

Hi All,

I need to determine the receiver if the field value after rounding is != "0.000"

Example:If Field=5.6788 then output after rounding should be 5.679

If Field=6.2313 then output after rounding should be 6.231

Thanks,

Sudha.

Former Member
0 Kudos

hi ,

use round- half- to- even(field,3) . i guess this wil meet ur requirement..

for a reference kindly chk this link

[http://books.google.co.in/books?id=kcqaqDGpj1MC&pg=PA212&lpg=PA212&dq=roundingto2decimalsin+xpath&source=web&ots=z3dJhBFScM&sig=eypacJpsX98DVUdVCtZWsp7DExI&hl=en&sa=X&oi=book_result&resnum=2&ct=result]