Display Large Float w/o Scientific Notation

I have a series of dollar amounts (from an SQL cursor) that I am summing up using a java.lang.Float. The values total correctly, but when I display the value it is displayed using Scientific Notation (4.19150150185925 E12). I need to write my total value to a file that will be exported to another application (mainframe). Therefore, the value when written to the output file must be 4191501501859.25. How do I get the value in that form, instead of the scientific notation form?
Should I be using a different type to sum my values into? The max value my total can reach is 99999999999999999.999
Thanks.

No, I meant precisely what I said. If BigDecimal
does indeed have a valueOf method that accepts a
string, please notify Sun, as they will certainly
have to update the documentation -- didn't YOU
read the documentation link that you yourself
sent me?
No, of course not, I only checked that it indeed does not have any method that takes a String parameter and that the method to "add" numbers is really called "add".
By the way, a constructor that takes a String parameter does pretty much the same thing as a method that takes a String parameter and returns a new instance of the class. There is no significant difference between Float's valueOf(String) and the Float(String) constructor as far the user of the API is concerned.
(Looking up the source just for fun I see that Float.valueOf(String) and Float(String) do completely different things, and Float(String) creates a temporary extra Float object. The comment above says: "REMIND: this is inefficient". Interesting.)
Probably not, you were apparently too busy taking
a 'tude.No doubt! :-)

Similar Messages

  • Prevent large numbers from becoming scientific notation on CSV import

    Hi, I'm importing contacts in a .CSV file into iWork Numbers and it takes a 12-digit phone number from a guy in the UK and turns it into scientific notation. So something like 447729803988 becomes 4.4772E+11 which obviously loses some important digits. Is there a way to force Numbers to treat all fields as text on import so it doesn't drop this critical data? thanks
    Sean

    scrollin,
    Your digits are all there. Just format those cells to either Text or Number. Leading zeros do tend to get lost unless you pre-format to text. You can force the cell format to text on the fly by prefixing your input with a single-quote.
    Regards,
    Jerry

  • Scientific notation doesn't display correctly

    Hi, this is just a general question but it's about the Calculator app. The problem is with displaying answers in scientific notation. When I'm in scientific calculator mode, answers displayed on the screen only appear in scientific notation when they are larger than the number of digits that can be displayed. However, whenever I use it to calculate something in which the answer is smaller than the set precision for the number of decimal places, it always gives 0 instead of scientific notation. For example, if I type a number such as 1E19 and press =, then the answer displays correctly as 1E19. However, if I type 1/1E19, and press =, then the answer simply shows up as 0 instead of 1E-19, which is the correct answer in scientific notation. So, it seems that the scientific notation in Calculator simply does not display negative exponents in the scientific notation (I know that I can type such numbers but for some reason, it cannot display them as answers). This is very annoying because I often work with very small numbers, not just very large ones. Is there any way that I can get the scientific notation to display negative exponents when I'm working with very small numbers and when the answer is smaller than the set number of decimal places?

    There are tonnes of possibilities and many websites with suggestions. I tried all sorts of these option (clear cache, clear cookies, anti-virus changes, page style options etc) with no success until eventually I accidentally changed my character encoding autodetect (firefox 6) from "off" to "universal" and everything is fine.

  • Float Data Value and Scientific Notation

    Hello All,
    SQL Server converts some of the float value into scientific notation for example 0.00001 will be stored as
    1E-05.
    Is there any simple method\formula\threshold to precisely tell when some particular value will be converted to scientific notation?
    Also I think oracle store same value above i.e. 0.00001 as it is with float data type but not the case with SQL Server. Any reason for the same?
    Thanks in Advance.
    -Malkesh

    Thanks Erland.
    I got your point that internal storage as you mentioned will be 53 bit and 11 bit exponent of 2. However my question remains the same that is there any method\threshold from which we can say that after this numeric value stored data will be represented in
    scientific notation or any rule of thumb? For example
    drop
    table #t
    CREATE
    TABLE #T (T1
    FLOAT)
    INSERT
    INTO #T (T1)
    SELECT 0.000001
    INSERT
    INTO #T (T1)
    SELECT 0.00001
    INSERT
    INTO #T (T1)
    SELECT 0.0001
    INSERT
    INTO #T (T1)
    SELECT 0.001
    INSERT
    INTO #T (T1)
    SELECT 0.01
    INSERT
    INTO #T (T1)
    SELECT 0.1
    INSERT
    INTO #T (T1)
    SELECT 1.
    INSERT
    INTO #T (T1)
    SELECT 1.0
    INSERT
    INTO #T (T1)
    SELECT 1.01
    INSERT
    INTO #T (T1)
    SELECT 1.001
    INSERT
    INTO #T (T1)
    SELECT 1.0001
    INSERT
    INTO #T (T1)
    SELECT 1.00001
    INSERT
    INTO #T (T1)
    SELECT 1.000001
    INSERT
    INTO #T (T1)
    SELECT 1.0000001
    INSERT
    INTO #T (T1)
    SELECT 1.00000001
    INSERT
    INTO #T (T1)
    SELECT 1.000000001
    INSERT
    INTO #T (T1)
    SELECT 1.0000000001
    INSERT
    INTO #T (T1)
    SELECT 1.00000000001
    INSERT
    INTO #T (T1)
    SELECT 1.000000000001
    INSERT
    INTO #T (T1)
    SELECT 1.1
    INSERT
    INTO #T (T1)
    SELECT 10.1
    INSERT
    INTO #T (T1)
    SELECT 100.1
    INSERT
    INTO #T (T1)
    SELECT 1000.1
    INSERT
    INTO #T (T1)
    SELECT 10000.1
    INSERT
    INTO #T (T1)
    SELECT 100000.1
    INSERT
    INTO #T (T1)
    SELECT 1000000.1
    INSERT
    INTO #T (T1)
    SELECT 10000000.1
    INSERT
    INTO #T (T1)
    SELECT 100000000.1
    INSERT
    INTO #T (T1)
    SELECT 1000000000.1
    INSERT
    INTO #T (T1)
    SELECT 10000000000.1
    INSERT
    INTO #T (T1)
    SELECT 100000000000.1
    INSERT
    INTO #T (T1)
    SELECT 1000000000000.1
    SELECT T1
    FROM #T
    Here you can see value < 0.0001 i.e. 0.00001 and 0.000001 both are in scientific notation. So which rule or formula drives this behavior that is what my question is. Sorry I am somewhat poor in mathematics fundamentals So if you can make it simple.
    Thanks Again.

  • Need to "turn off" (disable) scientific notation

    How can I prevent real (floating point - whatever) numbers from displaying (within a table) in scientific notation. Appears to be for numbers > 9999999.. The number 27000000 is displayed as 2.7E7
    Thanks

    Drop the Number Converter on the component and specify the number of pre and post decimal digits.
    See http://developers.sun.com/jscreator/learning/tutorials/2/converters.html

  • Calculator and Scientific Notation

    My Calculator App seems to randomly switch back to scientific notation instead of displaying results in regular x.xx format.
    I tried deleting the com.apple.calculator.plist file and then relaunching Calculator but that didn't work.
    Any other suggestions on how to get the calculator app back to displaying results in normal (non-scientific notation) mode?
    thanks

    Then, I'm at a loss. Mine only shows scientific notation when the value exceeds whatever's set as the number's max range. You might want to peruse Calculator's help files.

  • Key Figures being displayed in Scientific Notation

    Hi GURU's,
    I have created a Analysis Process Designer (MultiCube to Flat File) and everything seems to be ok in that but the output for 2 of the key figures are in scientific notation (i.e. 10 decimal places) and this needs to be fixed up immediately.
    The value of the Key Figure is displayed as 1.72E04 instead of 1,7231810000000001E04
    How do I go about solving this issue.
    Thanks & Regards,
    Praveen Battula

    I think in floating point math adding 1 to 9999999999999899999999 is going to be a meaningless operation as by the time one converts 1 to a floating point of the scale & precision needed to represent 9999999999999899999999, it's going to lose any significance (ie: it's going to basically be represented as zero).
    You'll need to do a search on how to deal with numbers of very high precision & scale.  I don't have any code to hand.  Have you done any of your own investigation on how to deal with this?
    Adam

  • How to prevent display in scientific notation

    I want to convert a large double value to a string,
    but when the value is greater than 10000000 , it will display in
    scientific notation , such as 3.435E8
    However, how can I convert it automatically to 343500000 because
    there is an interface program which do not accept the scientific
    notation format
    Thanks in advanced

    Start here: http://java.sun.com/j2se/1.4/docs/api/java/text/NumberFormat.html

  • Why Number displayed in  scientific notation

    I have tried to add two numbers and got a result displayed in scientific notation.
    Then I have used the 'decimalformat()' function and result is wrong.
    How can display the correct result. Please help
    Please see the code I have used
    <cfset N1=1>
    <cfset N2=9999999999999899999999>
    <cfset RESULT = N1+ N2>
    <cfoutput>
    #RESULT#
    <br />
    #decimalformat(RESULT)#
    </cfoutput>
    result :
    1E+022
    92,233,720,368,547,760.00
    Thanks in advance

    I think in floating point math adding 1 to 9999999999999899999999 is going to be a meaningless operation as by the time one converts 1 to a floating point of the scale & precision needed to represent 9999999999999899999999, it's going to lose any significance (ie: it's going to basically be represented as zero).
    You'll need to do a search on how to deal with numbers of very high precision & scale.  I don't have any code to hand.  Have you done any of your own investigation on how to deal with this?
    Adam

  • Display Scientific Notation values in columns

    Hi,
    I have a column in a table that apparently displays the values in
    Scientific Notation. That is, the value in each column is always
    displayed as "6.4211E+15". Each value in this column should be a
    unique or different value. If I type "select * from <table_name>
    where <column_name> != 6.4211E+15;", I still get every row in
    this table. Is there a way to display the full value of this
    column so that I can view the unique value for each of these
    rows? If so, how does one accomplish this?
    Thank you,

    Welcome to SDN.
    do you mean to say that in some rows some column values will be blank and you want to replace the blanks with '-'.
    loop thru the itab which you are passing to tableview and for the blank cells pass '-'.
    <i>Also when the value is inserted at run time</i>
    so you are having editable tableview. to update the value back to the dbtable, you have to read it in oninputprocessing and update it to dbtable .
    search the forum on how to read the user entered value from the table view so that you can update the dbtable.
    Regards
    Raja

  • Convert Scientific Notation to Float

    Hello
    How can we convert Scientific notation to float.
    e.g.
    1.23E-3(string) as  0.00123(float)
    Thanks
    Solved!
    Go to Solution.

    Use Fract/EngStringToNumber. Or ScanFromString with format %f…
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Displaying Scientific Notation

    I see a lot of people asking questions about how to prevent showing Scientific Notation.  I have the opposite problem, I can't seem to show scientific notation.
    In the field I'll Enter: 2.5E-5
    After commit, the value show: 0
    If I look in the database, it shows: 0.000027
    How can I get the form to show 2.5E-5?
    My Entity Attribute:
      <Attribute
        Name="Stock"
        ColumnName="STOCK"
        SQLType="NUMERIC"
        Type="oracle.jbo.domain.Number"
        ColumnType="NUMBER"
        TableName="WASTE_STREAM_NUCLIDE">
        <Properties>
          <SchemaBasedProperties>
            <DISPLAYWIDTH Value="8"/>
          </SchemaBasedProperties>
        </Properties>
      </Attribute>
    My Field on the Page:
                    <af:inputText value="#{bindings.Stock.inputValue}" label="#{bindings.Stock.hints.label}"
                                  required="#{bindings.Stock.hints.mandatory}"
                                  columns="#{bindings.Stock.hints.displayWidth}"
                                  maximumLength="#{bindings.Stock.hints.precision}"
                                  shortDesc="#{bindings.Stock.hints.tooltip}" id="it2">
                        <af:convertNumber groupingUsed="false" pattern="0.######E0"/>
                    </af:inputText>

    Good point. If everyone having problems with SQL*Plus number formatting went to the free online HTML manual, looked for "NUMBER" in the index and found
        NUMBER
            column definition from DESCRIBE, 12
        NUMBER clause, 5.12.2
            VARIABLE command, 12
        NUMBER columns
            changing format, 6.1.2.1, 12
            default format, 6.1.2.1, 12
        number formats
            $, 6.1.2.2
            0, 6.1.2.2
            9, 6.1.2.2
            comma, 6.1.2.2
            setting default, 5.9.4, 5.9.4, 12, 12
        NUMFORMAT clause
            in LOGIN.SQL, 2.2.2.1
        NUMFORMAT variable, 12, 12
        NUMWIDTH variable, 12, 12
            effect on NUMBER column format, 6.1.2.1, 12then we'd have nothing to do.

  • BIGINT in scientific notation

    Hi,
    New here and new to CF8. I'm using MySQL 5.0.51b with the
    latest JDBC connector and am getting unsigned BIGINT columns larger
    than 10^12 back in scientific notation instead of a whole number.
    Here's an example:
    <cfquery name="get_bigint" datasource="ds">
    select cuid,convert(cuid,signed) as c_cuid
    from ctable
    where id=17
    </cfquery>
    <cfdump var="#get_bigint#">
    cuid is an unsigned BIGINT in ctable. In the CF dump, cuid is
    displayed in scientific notation and c_cuid is displayed as a whole
    number. If I try to use cuid, say as a URL parameter, it also ends
    up in scientific notation, which is obviously undesirable. Is there
    a configuration setting I need to change somewhere or is the CF /
    JDBC way to deal with this to use CAST / CONVERT on BIGINT columns
    to ensure they stay in whole number format?
    Thanks

    Hi,
    the function FIXED (<your expression>, <number of digits) may help
    Elke

  • 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

  • Remove scientific notation in report

    I'm calculating a number and placing it in a comment box on a report. This works fine, but one of the numbers has decided to display in scientific notation (1.52666667e-3). The problem is that the comment box is not large enough to display the scientific notation and gives no indication of not fitting into the box. Instead I see 1.52666 with no indication of the exponent. I'd much rather see .001527 however I don't want to force a STR format with "d.dddddd" because most numbers don't need this much precision and I'd probably run into errors for numbers such as 12345 which won't fit into the comment box with forced 6 digit precision. If I can force it out of scientific precision, it'll probably be fine.
    BTW: is there a certain number range where scientific notation becomes the default? If I knew this range I could then force the format with the STR function to display the way I want. e.g. IF x>-001 and x<.001 then STR(X,"d.dddd")
    Either method would probably work for me.
    thanks,
    James
    Solved!
    Go to Solution.

    MyVar is a 2 dimensional pointer (Channel Group, Channel) to numeric channels that meet some criteria.
    change box size: I had to make the box 3 times the width to display the number correctly. It shows 1.27933333333333E-03*. I'm appending the "*" to show the field is calculated instead of unadultered from the .csv. Maybe the problem isn't that the number is small, but that it's infinitely repeating. The number is calculate from the values .001919 - abs(.001919)/3
    Left Justify: no difference from right justify.
    Autoadj: shows 1.28E-
    I'm making a column of channels on the report, that's why the comment text is being set multiple times.
    Humphreyy - thanks for your ideas and help.

Maybe you are looking for

  • Can I connect the displays of 2 mac book pros?

    I now have 2 macbook pros - one 2011 and another 2013 model, both running the latest OSX 10.9.4, can I hook up the monitors so one is an extended desktop of another?

  • Can't drag files from Assets folder to bin

    I have the free trial; 8.1 - running a Mac OS X 10.9.5 I'm on the second video of the tutorial. I cannot get any of the files - jpg or mp4 - to drag into the Footage or Stills folder. This very simple, basic move is keeping me from going forward in t

  • Mini (2010) on 42'' Daewoo LCD

    I've recently purchased a brand new 2010 Mac mini and, so far, I'm loving it. But, I've also bought a 42'' Daewoo FullHD LCD TV (DLX-42L1F). The problem: When I hook up the mini via HDMI to the LCD, I initially get a 720p output. If I go to settings

  • [SOLVED] Distorted text

    Text sometimes becomes distorted, as you can see in this image.  At times it is much worse than this. http://i.imgur.com/VG0gv.png The installation is only a few days old.  Does anyone know what could be causing this?  It happens mostly in the browse

  • Receiving ERRORS using WEBLOGIC.DEPLOY

    Hi everybody, I am getting strange errors when using the weblogic.deploy command-line function. I am using WL6.0 on W2000. Deploy/Update command: java weblogic.deploy -port 7001 -host localhost update beapasword MyWebApplication stage\MyWebApplicatio