AllegraSptbg Posted February 1, 2013 Share Posted February 1, 2013 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? Quote Link to comment Share on other sites More sharing options...
AllegraSptbg Posted February 4, 2013 Author Share Posted February 4, 2013 Should this be posted on a different board? Quote Link to comment Share on other sites More sharing options...
step Posted February 4, 2013 Share Posted February 4, 2013 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]; Quote Link to comment Share on other sites More sharing options...
AllegraSptbg Posted February 4, 2013 Author Share Posted February 4, 2013 Thanks Step. That works, but I need it to add the 1 at the end. Will I be able to modify this code so that the number will display as 472000000000000001? Quote Link to comment Share on other sites More sharing options...
step Posted February 4, 2013 Share Posted February 4, 2013 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? Quote Link to comment Share on other sites More sharing options...
AllegraSptbg Posted February 5, 2013 Author Share Posted February 5, 2013 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 Quote Link to comment Share on other sites More sharing options...
step Posted February 5, 2013 Share Posted February 5, 2013 Both of your examples are "4.72E+16" but convert to two completely different numbers. There is not way to write logic to convert the numbers (other than using Excel) from my perspective. Quote Link to comment Share on other sites More sharing options...
AllegraSptbg Posted February 5, 2013 Author Share Posted February 5, 2013 That's what I was afraid of. Thank you for your help Step. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted February 5, 2013 Share Posted February 5, 2013 Microsoft Excel is not a database application. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.