cancel
Showing results for 
Search instead for 
Did you mean: 

18 digit number outputs as '9.87654321098765e+18'. Need help to format.

Former Member
0 Kudos

My data source returns a field of type text that holds a long number. Instead of showing the actual number VC formats it as shown in subject.

I have tried multiple variants of converting to number and formatting to not show decimal places.

How do I get VC to display the number as is?

Seems that the 16th digit triggers this behavior. The 15 digit number '987654321098765' displays fine, while '9876543210987654' displays '9.87654321098765e+15'.

Points up for grabs.

Henning Strand

Edited by: Henning Strand on Feb 27, 2008 12:54 PM

Accepted Solutions (0)

Answers (2)

Answers (2)

Gustavo
Explorer
0 Kudos

Hi Henning,

I have the same problem.

My data service return a TEXT field with 44 digits (all digits are NUMBERS). When I test using "Test Data Service" on Visual Composer, it shows correctly, but when I test in runtime it shows like "xxxxxxxxxxxxxxxxxxxxxe+xx".

Did you resolve this problem?

Regards,

Gustavo.

Former Member
0 Kudos

SAP says we have to wait for an Adobe Flash update:

This issue is something that we know and aware of. It is a limitation of the flex runtime that VC is running over. In VC, you model the application to a generic XGL code that can be run over several runtime environments (Flash / WebDynpro / DHTML / HTMLB). Since Flash (or Flex) uses a certain representation for such large numbers, you see the result as an exponent representation. This is Flex limitation (we've checked it with Flex support) that will be changed in one of their next releases.

Work around:

As you found out from your data source test, VC actually handles your 44 digit number as it should. So you just have to trick flex. You actually need to split your incoming data into two or more parts and then join them back up when displaying in Flex.

I did this in my SQL query data source: "select substr(SSCC_Number,1,9) as SSCC1, substr(SSCC_Number,10) as SSCC2 from ...".

I then manually added two new fields in my data source's output port called SSCC1 and SSCC2 to receive the data. Then I added a third field SSCC1_2 with the formula "@SSCC1&''&@SSCC2" added in the 'Compute' field. I then use this field for later displaying or storing of the data without error.

Hope this brings you a bit further.

Henning Strand

Former Member
0 Kudos

Hi,

for me its working fine ,i think its a Bug with your SP.

I am working on SP15.

What is ur SP?

Regards,

Govindu

Former Member
0 Kudos

Govindu

I am on SP14.

My data source is a database table via JDBC (same thing happens for MS Access and Oracle). With a simple Oracle select like "select '9876543210987654' as number from dual" number is returned as 9.87654321098765e+15 and I cannot find a solution on how to change this back.

Henning

Former Member
0 Kudos

Hi,

I tested your problem like this,

Drag a Formview and add a Number input filed ,given a Default vaule 123456789012345(15Digits).

its given as 123,456,789,012,345.00 in runtime with Flex Compiler i did not got ur output .

Is it right way only to test for ur problem .

Otherwise Reproduce ur problem with samll steps or send gml of ur model i will tset on my SP14 Portal and let u know the Problem

Regards,

govindu

Former Member
0 Kudos

Govindu

I agree, this is no problem. I also tried a form view, but like this:

Add one input field with submit action that sends the input value to a data store variable. Then add an expression field that displays the data store variable. Here I can display whatever number I like without problems.

The problem is related to the data source sending in a 16 digit+ string. VC converts the value. This is actually common also for Excel, Toad and other apps, but in these I am able to set the field to an ordinary character value and then the problem disappears. VC doesn't work like this, unfortunately.

It's a bit puzzeling why VC would output a formatted number when the field is set to 'Text'.

Henning

ThatSAPGuy
Advisor
Advisor
0 Kudos

Henning-

I am on SP10 and I could not reproduce the problem you are facing. I created a form with an input field of type text (for input), another input field of type text (for output), and a submit button. On the submit event I populated the value entered in the first input field to a data store (again containing field of type text). The second input field was defaulted with the value in the data store. With this model no matter how many digits I provide in the first input field it is displayed as desired in the second input field.

However, if I change the type of the input fields from text to number I get the number in an exponential form (when exceeding 15 digits)

Please check if the data type in your form and data store is of type text.

Cheers-

Atul

Former Member
0 Kudos

Again, I agree. When using VC without a remote data service I have no problems displaying 16+ digit numbers, like described earlier.

The problem is that a remote data service (an sql statement to a database) returns a character string that VC formats like described.

Henning Strand

Former Member
0 Kudos

Hi,

i did not got ur problem .If u dont mind can you send the GML of ur problem so that i will try to analyze.

.

Send to govindu.nagotla@sap.com

Regards,

Goivndu