‎2006 Aug 17 10:58 AM
Hi,
I have a statement:
gs_unitprice = grkwert / <fs>-kwmeng.
result: gs_unitprice = 2,40708
gs_unitprice is defined as CURR field, 13 long, 5 decimals
Now, we want to only print the number with 4 decimals WITHOUT rouding the number.
So now my smartform prints: 2,4071 but they don't want this.
They want that my smartform prints 2,4070.
I've tried a lot of things, like making a type of field with 13 long, 4 decimals and move my field to that, but with the move it also rounds it up to 71 ...
Thanks a lot!
‎2006 Aug 17 11:05 AM
Hi,
how about if you do this:
split gs_unitprice at ',' into myinteger mydecimals.
mydecimals = mydecimals+0(4)
concatenate myinteger ',' mydecimals into gs_unitprice.
With concatenate perhaps you need a field of type C or String.
‎2006 Aug 17 11:02 AM
define a variable for 13 with decimals 4 and use the ciel function.
lnew = ciel( lold ).
Regards
Anurag
‎2006 Aug 17 11:04 AM
Use the function ROUND with input = gs_unitprice
an decimals as 4.
CALL FUNCTION 'ROUND'
EXPORTING
DECIMALS = '4'
INPUT = gs_unitprice
IMPORTING
OUTPUT = gs_unitprice
EXCEPTIONS
INPUT_INVALID = 1
OVERFLOW = 2
TYPE_INVALID = 3
OTHERS = 4.
Regards,
Ravi
‎2006 Aug 17 11:05 AM
Hi,
how about if you do this:
split gs_unitprice at ',' into myinteger mydecimals.
mydecimals = mydecimals+0(4)
concatenate myinteger ',' mydecimals into gs_unitprice.
With concatenate perhaps you need a field of type C or String.
‎2006 Aug 17 11:15 AM
Hi,
I thim\nk the simplest would be to take the value in the character format. Split the character at the '.'. Take the 4 characters of the split portion and concatenate it with the first half.
the syntax for splitting is given in above reply. U can refer that.
Hope this solves ur problem.
regards,
Ankit.
‎2006 Aug 17 1:49 PM
Hi !
Thanks a lot for your reply!
It works by splitting the stuff!