2007 Mar 15 1:01 PM
Team,
I have a field in CRM SMOKNA1-UMSA1 which has dollar and cents. I want only the dollars moved to another field aSales. The field aSales can only handle upto 14 digits.
How can I capture/concatenate dollar part of SMOKNA1-UMSA1 and save it in aSales?
Thanks
2007 Mar 15 1:06 PM
2007 Mar 15 1:06 PM
2007 Mar 15 1:06 PM
2007 Mar 15 1:14 PM
Hi.....
Use the function <b>TRUNC</b> it will give the Integer part of argument..
Ex:
if num1 = 10.23 then TRUNC(10.23) will give the output as 10.
you can also use <b>FLOOR</b> - it will give the Largest integer value not larger than the argument.
Ex:
if num1 = 10.23 then FLOOR (10.23) will give the output as 10.
Reward points if useful......
Suresh......
2007 Mar 15 1:24 PM
Hi....
FLOOR( -10.35 ) will give u -11 and FLOOR( -10.35 ) will give u -10 .
Just understand the following code and decide weather to use <b>TRUNC or FLOOR</b> based on your requirement.
DATA: NUM1 TYPE P DECIMALS 2 VALUE '10.35',
NUM2 TYPE I,
NUM3 TYPE I.
NUM2 = TRUNC( NUM1 ).
NUM3 = FLOOR( NUM1 ).
WRITE:/ 'Number is' , NUM1.
WRITE:/ 'TRUNC = ', NUM2.
WRITE:/ 'FLLOR = ', NUM3.
NUM1 = '-10.35'.
NUM2 = TRUNC( NUM1 ).
NUM3 = FLOOR( NUM1 ).
WRITE:/ 'Number is' , NUM1.
WRITE:/ 'TRUNC = ', NUM2.
WRITE:/ 'FLLOR = ', NUM3.
Reward points if useful.....
Suresh.......