Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Floating point

Former Member
0 Likes
1,045

Hi all,

I am getting the the output from a function nodule as 1.0000000000000000E+00

I am want to convert this output to 1 or accordingly.can anybody suggest

a way...

helpful answers will be rewarded

Regards,

jinesh

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
961

hi,

assign that value to a variable to type i.

thanks,

praveena

7 REPLIES 7
Read only

Former Member
0 Likes
962

hi,

assign that value to a variable to type i.

thanks,

praveena

Read only

Former Member
0 Likes
961

Hi,

Look at the below link

http://www.cs.tut.fi/~jkorpela/round.html

Regards

Sudheer

Read only

former_member188827
Active Contributor
0 Likes
961

move it to a variable of following type

p decimals 0.

Read only

varma_narayana
Active Contributor
0 Likes
961

Hi

<b>WRITE: V_FLOAT EXPONENT 0.</b>

THIS WILL GIVE U THE SOLUTION.

<b>REWARD IF HELPFUL</b>

Read only

Former Member
0 Likes
961

HI,

try this code:

DATA : STR TYPE STRING VALUE '123.00000000000'.

SHIFT STR RIGHT DELETING TRAILING '0'.

REPLACE '.' WITH '' INTO STR.

WRITE STR.

out put is 123.

do reward points if it helps

rgds

Read only

Former Member
0 Likes
961

hi check this code:

DATA : V_FLOAT TYPE F VALUE '2456.00000000',

V_CHAR(25),

P10_4(10) TYPE P DECIMALS 8.

data str type string.

CALL FUNCTION 'CEVA_CONVERT_FLOAT_TO_CHAR'

EXPORTING

FLOAT_IMP = V_FLOAT

FORMAT_IMP = P10_4

ROUND_IMP = ' '

IMPORTING

CHAR_EXP = V_CHAR.

WRITE : V_CHAR.

str = v_char.

SHIFT STR RIGHT DELETING TRAILING '0'.

REPLACE '.' WITH '' INTO STR.

WRITE STR.

first a variable is converted from float to character using the fm.

the output is 2456.

plz reward points if it helps.

rgds.

Read only

Former Member
0 Likes
961

Thanks all for the valuable helps