Jump to content

Convert Number from Excel


Recommended Posts

I have a number in a data column in excel displaying 4.72E+16, but I need it to read 47200000000001001. Currently I am achieving this in Excel by formatting the cells to a Number with 0 decimal places and entering 01 for the type in Custom. Is there a JavaScript in FusionPro to achieve this same result?
Link to comment
Share on other sites

I think that's really something that you should convert in Excel by changing the field type to "text" rather than "number." Especially since "4.27E+16" is equal to "47200000000000000."


But if you're okay with that, something like this might work for you:


var s= Field("YOUR FIELD");
s = s.split("E");
return Math.pow(10,Int(s[1])) * s[0];

Link to comment
Share on other sites

I assume you want the 14th digit to be a "1" also? This goes back to what I was saying about if you want the literal number you should edit the data in Excel. Do you have an example of some of the other numbers you'd like to convert and what their output should be?
Link to comment
Share on other sites

Sorry Step. I think I copied an old number. The only number that will truly need to be a "1" is the last digit. I am just trying to keep from having to touch the Excel spreadsheet at all and have FusionPro do all of the work. I cannot get the output I want in Excel by converting it "text" without also going through the extra step of formatting the cell to "custom" and changing the type to "01".


Here is another example: 4.72E+16 needs to convert to 472001055674610001

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...