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 to Decimal Conversion

Former Member
0 Likes
1,170

Hello Guys,

How can convert a floating point value to a decimal value. I donot want the user preference of , or dot to be considered I just want a , in the value and I also dont want rounding off.

With regards,

Avisesh.

3 REPLIES 3
Read only

Former Member
0 Likes
760

hi,

move the floating point value to a type P variable .

data : v_p type P decimals 3.

Read only

0 Likes
760

Hi,

1 - Move your field to a char field w_char.

2 - then use the "TRANSLATE" statement.

translate w_char using '.,'

Hope this helps,

Erwan

Read only

Former Member
0 Likes
760

Hello,

Use this code.

<b> DATA: CHAR1(30).

DATA: CHAR2(30).

WRITE: G_R_OBJECTS-ATFLV TO CHAR1 EXPONENT 0 DECIMALS 3.

CONDENSE CHAR1 NO-GAPS.

WRITE: G_R_OBJECTS-ATFLB TO CHAR2 EXPONENT 0 DECIMALS 3.

CONDENSE CHAR2 NO-GAPS.</b>

Hope this will helps you.

Vasanth