cancel
Showing results for 
Search instead for 
Did you mean: 

rounding issue when the number is a whole number

Former Member
0 Kudos

Hi guys,

I have a UDF (type is units and totals, price) which I named U_BILLPRICE. Since SAP has some issues in rounding results of formatted searches, I have inserted this query in my quantity column:

Select CONVERT (CHAR(19),(CAST((ROUND($[$38.U_UPINVTUM.number] / $[$38.U_UMCONV.number], 5)) as decimal (16,5))))

The query works if my U_BILLPRICE has decimal for example 24,030.20. It works fine. But if my U_BILLPRICE is a whole number for example 24,030. It disregards the decimal places.

example: U_BILLPRICE = 24,030/100 is equal to 240.30 but using the above query it just gives me 240.

Please help.

Thank you,

Jacki

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Jacki,

What result would be if you just use:

Select $[$38.U_UPINVTUM.number\]/$[$38.U_UMCONV.number\]

Thanks,

Gordon

Former Member
0 Kudos

Hi Gordon,

Thanks for replying.

Based on the above example, it would be 240 only. The correct output should be 240.30...I was wondering because the problem would only occur on whole numbers.

Thanks,

Jacki

Former Member
0 Kudos

Please refere below thread:-

--Marks as answer if your problem is resolved.

Regards,

former_member204969
Active Contributor
0 Kudos

Try to use something like this:

Select str($[$38.U_UPINVTUM.number]/$[$38.U_UMCONV.number],16,5)

Former Member
0 Kudos

Hi guys,

Thanks everyone for all your replies. Really appreciate it.

Regarding my problem, I was able to figure it out with the help of our programmers.

Thank you,

Jacki