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

SAP Script

Former Member
0 Likes
432

Hi all,

How can i specify an exponent for floating Point Numbers???

Thnaks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
401

HI,

see,

The way a floating point number is formatted depends on whether an exponent is specified. The mantissa is adjusted by shifting the decimal point and, if necessary, introducing leading zeros, according to the exponent chosen. Using an exponent value of 0 means that the exponent representation will not be used for displaying the symbol.

Syntax

&symbol(EN)&

If you specify an exponent of 0, then the number is displayed without using the exponent representation. This has the same effect as completely omitting the specification of an exponent: &symbol(E0)& has the same effect as &symbol(E)&

In this example, the PLMK-SOLLWERT field is assumed to have the value 123456.78 and to be of data type FLTP.

&PLMK-SOLLWERT& -> 1.23456780000000E05

&PLMK-SOLLWERT(E3)& -> 123.456780000000E03

&PLMK-SOLLWERT(E6)& -> 0.12345678000000E06

&PLMK-SOLLWERT(E0)& -> +123456.780000000

&PLMK-SOLLWERT(E)& -> +123456.780000000

3 REPLIES 3
Read only

Former Member
0 Likes
402

HI,

see,

The way a floating point number is formatted depends on whether an exponent is specified. The mantissa is adjusted by shifting the decimal point and, if necessary, introducing leading zeros, according to the exponent chosen. Using an exponent value of 0 means that the exponent representation will not be used for displaying the symbol.

Syntax

&symbol(EN)&

If you specify an exponent of 0, then the number is displayed without using the exponent representation. This has the same effect as completely omitting the specification of an exponent: &symbol(E0)& has the same effect as &symbol(E)&

In this example, the PLMK-SOLLWERT field is assumed to have the value 123456.78 and to be of data type FLTP.

&PLMK-SOLLWERT& -> 1.23456780000000E05

&PLMK-SOLLWERT(E3)& -> 123.456780000000E03

&PLMK-SOLLWERT(E6)& -> 0.12345678000000E06

&PLMK-SOLLWERT(E0)& -> +123456.780000000

&PLMK-SOLLWERT(E)& -> +123456.780000000

Read only

Former Member
0 Likes
401

Hi Amar,

It can be done like this.

&symbol(En)&.

where n is equal to 1,2,3 etc...

Regards,

SP.

Read only

Former Member
0 Likes
401

HI Amar,

In the Print program you can use this statement:

DATA float TYPE f, var(10).

float = sqrt( 2 ).

WRITE float EXPONENT <num> to var.