Create an NSString for number in scientific notation from double?

Hi
Given a double, I want to create a string in scientific notation.
e.g for a double with a value of 123.456, I want the NSString to be "1.23456e+2" for entering in to a UITextField.
I've looked through the docs but can't find a formatter. (There is mention of "%a" being scientific format, but it produces hex output.)
Thanks for any clues.
Steve

Here, you should find what you are looking for:
http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/Strings/Ar ticles/FormatStrings.html#//apple_ref/doc/uid/20000943
http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/Strings/Ar ticles/FormatStrings.html#//apple_ref/doc/uid/20000943
http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/ Classes/NSStringClass/Reference/NSString.html#//appleref/occ/clm/NSString/stringWithFormat:

Similar Messages

  • How to input a number of scientific notation in equations

    On new version of Numbers, I try to input a equation, such as "=A1 x 6.02E+23" , but I cannot input the equation, because "E" regarded as "columnE".
    Please tell me how to imput a a number of scientific notation in equations.

    You can override the parser using escape. This might be new to version 3.2, I don't remember it in 3.0 or 3.1. It used to override it until you hit Enter, then it would revert back into a cell reference. Now it is working correctly.
    = A1*6.02E (then hit ESC) 23
    The result will be
    =A1×6.02E+23

  • Create item class for Number values

    Hi,
    I want to create a item class for year like (current year+3).
    So i created the Item class in Dis.Admin But it wont reflect in Dis.plus parameter . So please tell me how to create a item class for Number values.
    Regards
    Manikandan

    Hi Rod
    I rarely use Desktop and neither do my customers, unless they are on versions of Discoverer prior to 10.1.2. Time and time again I have taught 10.1.2 Plus / Viewer to dyed in the wool Desktopees to finish the course for them to say that they are never going to use Desktop again.
    One of the many issues with Desktop is the caching and even though it can do some things that Plus cannot, the many features in Plus that don't exist in Desktop far outweight them.
    What do you think? Do you still see a use for Desktop?
    How about everyone else? I would love to hear from you.
    Best wishes
    Michael

  • Sharepoint 2013: Problem / Error when creating Variation Hierarchy for French and German Languages from Variation root EN

    Hi,
    I have a website with English and Arabic Language Packs installed. I have the corresponding Variation heirachies created and the whole site collection is published.
    Recently the client asked for french and german languages to be accomodated as well. So I followed the same approach I did for English and arabic (installed the language packs) for foundation, ran ocnfiguration wizard, installed server language pack &
    ran configuration wizard.
    But after creating the variation label, when i try to create the variation heirarchy, I am getting the following error.
    "Unknown failure when creating a variation of page http://server:port/en/pages/default.aspx in label /fr/Pages/default.aspx.
    The Variations Create Hierarchies job failed with the following error message&  Unknown failure when creating a variation of site
    http://server:port/en in label fr."
    Am not sure what is going wrong. Appreciate a feedback.
    Thanks,
    SSP
    SSP

    Hi,
    According to your description, my understanding is that the error occurred when you created the Variation Hierarchy for French and German Languages from Variation root EN.
    I recommend to check the Resources folder located at C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15 to see if the file core.fr-FR.resx exists in the folder.
    Here is a similar thread for you to take a look:
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/611575b2-d129-44c6-814b-2e5782178850/unknow-failure-when-creating-variations-in-sharepoint-2013-is-this-a-bug-in-sharepoint-2013-rtm?forum=sharepointadmin
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • Data retrieval in non-scientific notation from Netezza database

    Hi,
    I have a requirement where my BPEL service fetches data from Netezza database. In the database, there is a field which is of type numeric(16,8) and holds values say '0.00000000'. The select query on the table rerieves data in its scientific notation as '0E-8'.
    Please let me know how to retrieve its value in the form of non-scientific notation.
    Thanks in advance.
    Regards,
    Sitara

    hai
      chowdary,
       it is not possible to retrieve data from maintenace view.
    it is only possible to retrive data from a table or database
    / projection views defined ddic.
    Maintenace views are used to maintain data of an application object together.Data from several tables can be joined and summarized data can be seen of this view based on primary key join relationship using SM30.U make any changes  or view the data there only.
    if useful, reward points.
    By
    G.V.K.Prasad
    Edited by: PRASAD GVK on Apr 13, 2008 3:36 PM

  • Creating a Counter for number of records

    Hi Folks,
    I need to show number of purchase orders, quotation items and purchase requisitions in one report. i need to count the number of RFQs and purchase requisitions per purchase order. 
    I have put numeric 1 in update rules but it shows value 1 even if the number of PR is 2. and getting.
    I want to show the same number irrespective of Analysis (even if the anlysis changes from PO to cost center.)             
    I saw one How to Document on counter some time ago in sdn its not there now.
    Please send a reply for this requirement. Its urgent
    Can Anyone forward it to me.
    Regards
    Mahesh

    The document you are looking for can be found at the following link:
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/7e58e690-0201-0010-fd85-a2f29a41c7af">How to... Count the occurrences of a characteristic relative to one or more other characteristics</a>.
    Hope this helps...
    Bob

  • Is there some place where I can submit a ticket ? Seems like FF limits DOM elements' width and height to 10,000,000px since it transforms this number into scientific notation. e.g. 10,000,000px becomes 1e+7px which obviously can't be interpreted. Cheers

    I've reproduced this issue from FF 3.6.13 on windows XP and mac osx 10.6.8.
    On FF 3.6.13 the number of pixels limit seems lower with exactly 8,388,607.

    The 12" PB internals are a bit more complex, for PB's. If you don't want to replace the hard drive yourself or pay someone to install it, you could always get an external firewire hard drive, and use it to boot from and for general usage. Would have to be firewire, since the PB won't book from a USB device. One example of what you could get is a 160GB external hard drive: http://eshop.macsales.com/item/Other%20World%20Computing/MS4U5160GB8/ . All the choices with that case are listed here: http://eshop.macsales.com/shop/firewire/on-the-go
    Have you called any Apple Authorized Service Providers to see what they would charge to install a drive for you? Whether you bought it or they supplied it? You can find a local one in the US at http://www.apple.com/buy/locator/service/

  • Want to create RFC FM for Getting data in CRM from R/3

    Hi,
    I have made the RFC connection in CRM system , now I want to make RFC FM for getting data from R/3 'MARD' table into CRM, If any one help me how to do this.
    From CRM system I will pass Plant & material no to FM and I need Storage location & Storage Bin from R/3 MARD table in CRM.
    Thanks
    Bobby

    Dear Bobby,
    You would create a FM in SE37 select 'Remote Enabled Module' radio-button in attributes tab of Function Builder.
    Select matnr werks LGORT LGPBE
               from MARD
               into ET_MARD
               where matnr = i_matnr
               and  werks = i_werks.
    Note:
    matnr is material number
    werks is plant
    LGORT is storage location
    LGPBE is storage bin
    Hope this will help.
    Regards,
    Naveen.

  • Is there a way I can create a playlist for my TV Shows purchased from iTunes?

    Hi Guys,
    Recently upgraded to IOS7 and my video app has changed. I use the ipad in the car for my daughter and play a series of pepper pig continuously. However, with the new upgrade the option to play all epps in folder is not there anymore, it only allows you to play each eppisode indiviuadly and thats it.
    Can anybody please tell me if they've manage to play all TV Show downloads from Apple in a playlist? Its impossible to use the ipad in the car now as I would have to pull over every 5 minutes.
    Thanks in advance.

    See here: Creating an iTunes Store, App Store, iBookstore, and Mac App Store account without a credit card
    B-rock

  • How to convert from scientific notations to double value ?

    Hi all,
    i need to convert a string 2E-23 to corresponding double values so that i can compare it one more existing double value. Is there any API present for this ?
    Thanks and regards,
    rosamama.

    Note: This thread was originally posted in the Swing forum, but moved to this forum for closer topic alignment.

  • Decimal Format and Scientific Notation

    I am trying to print numbers in scientific notation using the Decimal Format class. What follows is a simple test program I wrote to find the bug. So far, I have not found a solution.
    import java.text.*;
    public class formatted {
    public static void main (String Arguments[]) {
    DecimalFormat form = new DecimalFormat("0.###E0");
         double numb = 123456.789;
         System.out.println("Nuber is: " +
    form.format(numb));
    The output of this program is... Nuber is: 123456E
    The output is the same if numb is an int, float, or double. If I format the number as "#####.0" or "#####.00" the output is correct. I think that I am following the rules for formatting a number in scientific notation as the process is outlined in the documentation (provided below).
    ***** From Decimal Format under Scientific Notation ***
    Numbers in scientific notation are expressed as the product of a mantissa and a power of ten, for
    example, 1234 can be expressed as 1.234 x 10^3. The mantissa is often in the range 1.0 <= x < 10.0,
    but it need not be. DecimalFormat can be instructed to format and parse scientific notation only via a
    pattern; there is currently no factory method that creates a scientific notation format. In a pattern,
    the exponent character immediately followed by one or more digit characters indicates scientific
    notation. Example: "0.###E0" formats the number 1234 as "1.234E3".
    Anyone understand how the short program is incorrectly written?
    Marc

    The problem is
    format = "0.###E0"
    input number = 123456.789
    output = 123456E (not scientific notation!)
    This is not scientific notation at all. There is no decimal point given and no value in the exponent.
    I understand entirely that by adding more #'es will provide more precision. The bug I have is the output is not printed in the scientific format; other formats work.
    MArc

  • To_number and scientific notation

    Hi
    I am trying to convert a number in scientific notation stored in a character ffield to a number.
    I use this statement, but gets a ORA-01722 error.
    What is wrong ?
    select to_number('1.1111111111111112E-6','9.9EEEE')
    from dual
    Preben

    Hi guys, I'm following this forum in order to reuse what you wrote, but I still have a problem with the scientific notation format...
    From SQL Plus If I run this query:
    select b.CONTRACT_NUMBER,b.id as cont_id from OKC_K_HEADERS_B b--, okc_k_lines_b v
    where b.contract_number = 'NR19Mini'
    I retrieve the following row:
    CONTRACT_NUMBER                       CONT_ID
    NR19Mini                           1.4733E+38where the CONT_ID datatype is NUMBER.
    Now I want to specify a condition using the CONT_ID field (for another use in the future), but if I use the following syntax
    select b.CONTRACT_NUMBER,b.id as cont_id from OKC_K_HEADERS_B b
    where b.contract_number = 'NR19Mini'
    and b.id = to_number('1.4733E+38','9.99999EEEE');
    I don't retrieve any rows (no rows selected)
    How can I modify the format number in order to see my row, and for example use it inside a join with another fied of the same type ?
    Thanks in advance
    Alex

  • DecimalFormat scientific notation if necessary

    I would like to find a way to output a double value in a way that uses scientific notation only if the number of digits output would be at least 15. For instance, the value 12345000000000000 should be output as 1.2345E16, but 12345000 would not be output in scientific notation (and the same logic if the value is < 0). Is this possible with the DecimalFormat class?
    I tried using String.format("%.15g", value), but that always displays trailing 0s to fill the significant digits (e.g. 12.345 outputs "12.3450000000000"). I don't want it to output the trailing 0s.

    I would like to find a way to output a double value
    in a way that uses scientific notation only if the
    number of digits output would be at least 15. For
    instance, the value 12345000000000000 should be
    output as 1.2345E16, but 12345000 would not be output
    in scientific notation (and the same logic if the
    value is < 0). Is this possible with the
    DecimalFormat class?
    I tried using String.format("%.15g", value), but that
    always displays trailing 0s to fill the significant
    digits (e.g. 12.345 outputs "12.3450000000000"). I
    don't want it to output the trailing 0s.With DecimalFormat ( http://java.sun.com/j2se/1.5.0/docs/api/java/text/DecimalFormat.html )
    you can format the number in scientific notation but to control which numbers are formatted I think you must write some sort of if else

  • Calculator.app Version 4.5.3 (99.2) and Scientific Notation

    I want to enter a number with scientific notation.
    2.71e1 doesn't return 27.1, but rather 0.999...
    It seems that Calculator.app is dividing by e.
    This is not a common operation.
    2.71E1 gives 27.1great! But ...
    2.71E-1 does not return 0.271 neither does
    2.71E(-1)
    I have yet to figure out how to use negative exponents in Scientific notation.
    This seems to be a bug in Calculator.app Version 4.5.3 (99.2)

    All my spaces were deleted.
    Take two.
    My input ======= Calculator
    2 ============ 2
    2. ============ 2.
    2.7 =========== 2.7
    2.7E ========== 2.7 E 0
    2.7E- ========== 2.7 (and the small - subscript indicating a negative number)
    2.7E-1 ========= 1 (and the small - subscript indicating a negative number)
    Now hitting enter === 1.7 (it appears to have subtracted 1 from 2.7)
    Do our version of Calculator match?
    Thanks for being interested.

  • WKT Contains Scientific Notation

    I have a table with an SDO geometry column. Our data is stored in Web Mercator to simplify displaying maps on a web page. My team's preferred way of shuffling geometries around is via its WKT since this is human readable and widely used. So we are fetching the WKT directly from the database using the GET_WKT() method (right term?) on the SDO geoemtry.
    The problem is that when coordinates exceed 10 million in magnitude, those coordinates are represented in E notation (see http://en.wikipedia.org/wiki/Scientific_notation#E_notation). I need to convert this WKT to a .NET object for use with a particular library, and while it supports conversion from WKT, it blows up on the E notation. I'd call it a bug with the library except for the fact that Oracle itself can't parse WKTs with E notation, either. SDO_UTIL.VALIDATE_WKTGEOMETRY returns FALSE for the WKT that GET_WKT() generated, and SDO_UTIL.FROM_WKTGEOMETRY throws an error. I've also tested that SDO_UTIL.SDO_UTIL.TO_WKTGEOMETRY returns the same WKT.
    A large amount of code already depends on the geometry being in WKT format, which means that switching to another format would not be an easy change. For the moment, I'm parsing the WKT using SQL Server's geometry type (see http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.types.sqlgeometry_methods.aspx), and then converting it back to a WKT without E notation using its STAsText() method.
    Is there a way to force Oracle to not return E notation coordinates?
    This is occurring in both of the following versions of Oracle:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    "CORE     10.2.0.1.0     Production"
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    PL/SQL Release 11.1.0.6.0 - Production
    "CORE     11.1.0.6.0     Production"
    TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
    NLSRTL Version 11.1.0.6.0 - Production
    Sample SQL:
    The SRID in the following queries does not seem to exist out of the box in version 10 or Oracle. I ran these queries through Oracle SQL Developer.
    Query:
    SELECT MDSYS.SDO_GEOMETRY(2003,3785,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1),MDSYS.SDO_ORDINATE_ARRAY(-13426771.266146,5334024.8870015,-13425624.710722,5326534.0582305,-13412553.978887,5325922.5620044,-13412936.164029,5333719.1388884,-13426771.266146,5334024.8870015)).GET_WKT() FROM DUAL;
    Result:
    POLYGON ((-1.3426771266146E7 5334024.8870015, -1.3425624710722E7 5326534.0582305, -1.3412553978887E7 5325922.5620044, -1.3412936164029E7 5333719.1388884, -1.3426771266146E7 5334024.8870015))
    Query:
    SELECT SDO_UTIL.VALIDATE_WKTGEOMETRY(MDSYS.SDO_GEOMETRY(2003,3857,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1),MDSYS.SDO_ORDINATE_ARRAY(-13426771.266146,5334024.8870015,-13425624.710722,5326534.0582305,-13412553.978887,5325922.5620044,-13412936.164029,5333719.1388884,-13426771.266146,5334024.8870015)).GET_WKT()) FROM DUAL;
    Result:
    FALSE
    Query:
    SELECT SDO_UTIL.FROM_WKTGEOMETRY(MDSYS.SDO_GEOMETRY(2003,3785,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1),MDSYS.SDO_ORDINATE_ARRAY(-13426771.266146,5334024.8870015,-13425624.710722,5326534.0582305,-13412553.978887,5325922.5620044,-13412936.164029,5333719.1388884,-13426771.266146,5334024.8870015)).GET_WKT()) FROM DUAL;
    Result:
    ORA-29532: Java call terminated by uncaught Java exception: java.lang.RuntimeException
    ORA-06512: at "MDSYS.SDO_UTIL", line 172
    29532. 00000 - "Java call terminated by uncaught Java exception: %s"
    *Cause:    A Java exception or error was signaled and could not be
    resolved by the Java code.
    *Action:   Modify Java code, if this behavior is not intended.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Hello jpmc26,
    I am going to guess that most of us live our lives between the 180s and have not really noticed this before. I would call it a bug that needs an SR opened but is the bug on the coming or the going? If you look in the Simple Features 1.2.1 specification on pages 52 and 53 they clearly say that an "approximate numeric literal" of mantissa + E + exponent is valid. However, Oracle Spatial does not support the 1.2.1 spec. Rather they support something akin to the 1.1.0 specification. On pages 28 and 29 of that version there is no mention of approximate numeric literals as it first shows up in the 1.2.0 specification.
    So I would say either:
    1) Oracle Spatial supporting only the 1.1.0 specification and not much interested in updating to current specifications, should remove the output of scientific notation from the SDO_UTIL.to_WKTGEOMETRY procedure (match 1.1.0 spec).
    -or-
    2) Oracle Spatial looking forward to future compatibility with new OGC standards, should add support for parsing scientific notation to the SDO_UTIL.from_WKTGEOMETRY procedure (prepare for 1.2.1 spec).
    I guess its a policy decision on their side. Please update the posting as to what they say as I am curious about the topic.
    Many folks have largely abandoned these java-based, outdated, OGC converters. Feel free to search the forum for complaints, myself being one of the complainers. When you said "a large amount of code already depends" on WKT, my first thought was that must be really slow. Writing your own SDO to WKT converter in PLSQL is really easy and I believe that's what most of us have done. The other direction is more challenging but doable - I need to rewrite mine but its works well enough for straightforward stuff.
    Cheers,
    Paul

Maybe you are looking for

  • Advantages of using activities over outlook

    Hello, All Can any one explain me the advantages of using activities over outlook? In Outlook you can schedule the activities for the whole day, see if the period of an activity clashes with another activity so you can reschedule it etc. In short, ca

  • Document Generation in MSA - Make Word Doc Read-Only or PDF Documents

    Hello, The mobile sales client comes with an Document Generation tool to fill Word Document Templates with SAP data on demand. Because of legal issues, we do not want to allow anyone to be able to modify the generated word document. Using the permiss

  • Windows Video Player: Windows Forms application (C#)

    I need to incorporate Windows Video Player in Windows Forms application (C#) using Visual Studio 2013, .Net Framework 4.5 , I have already MS Windows Media Player but it does not meet my demanding situation so I need third party media player control

  • Non-WLS client VMs using NonCatalogLogger

    Hi All- I've been playing around with the weblogic.logging.NonCatalogLogger. It works great. I'm even able to filter by subsystem when browsing the log file from the Administration Console. I have a couple of questions, though: 1.. How can I get a cl

  • Graph Chart settings

    Dear people, I have a chart in my code, I need to set beginning time externally ( I read it from a sting ). I need to set the first Chart Plotting point to this time , The samples/sec is also read from a txt file and has to be set extra. When code fi