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

Problem in Dcimal places

Former Member
0 Likes
780

Hi,

I have an output value which is Rs.8,92,466.50.

The issue is if am using the variable to display as character am getting the output as Rs.892466.50.(without commas).

If i use float am getting an output as 8.9246650000000000E+05.

If i use i am getting commas 8,92,466 but the end part is truncated.

Please help me and suggest how 2 use the particular data type so that i can get my required output of <b>Rs.8,92,466.50.</b>

With regards

Vijay

1 ACCEPTED SOLUTION
Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
753

Hi Vijay

Use the Pack Data type for the variable or set your User Profile in required format.

Regards,

Sree

Hi,

I have an output value which is Rs.8,92,466.50.

The issue is if am using the variable to display as character am getting the output as Rs.892466.50.(without commas).

If i use float am getting an output as 8.9246650000000000E+05.

If i use i am getting commas 8,92,466 but the end part is truncated.

Please help me and suggest how 2 use the particular data type so that i can get my required output of <b>Rs.8,92,466.50.</b>

With regards

Vijay

4 REPLIES 4
Read only

Former Member
0 Likes
753

Hi,

Used packed data type.

regards,

Santosh thorat

Read only

Former Member
0 Likes
753

j

Read only

former_member386202
Active Contributor
0 Likes
753

Hi,

declare that variable as type p with decimals 2

data : lv_var type p decimals 2.

otherwis use FM

*--Call function module to convert cycle & offset from floating to

  • character

CALL FUNCTION 'FLTP_CHAR_CONVERSION_FROM_SI'

EXPORTING

char_unit = v_unit

decimals = lc_dec

fltp_value_si = v_offset

indicator_value = c_check

IMPORTING

char_value = v_cycle

EXCEPTIONS

no_unit_given = 1

unit_not_found = 2

OTHERS = 3.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

Regards,

Prashant

Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
754

Hi Vijay

Use the Pack Data type for the variable or set your User Profile in required format.

Regards,

Sree