Format number after decimal

this column is defined like this
studuent_gpa  number(23,9)
I have a student
with this gpa
select studuent_gpa
from gpa
where student_id = 117254
3.816666667
I just want to dispay
3.816
I do
select studuent_gpa,'99D999')
from gpa
where student_id = 117254
and it rounded, I don't need to rounded just display the three numnbers after the decimal point
I try diffrent formats and it always rounded
I need to display 3.816
Thank you 

You mean you want something like this?
SQL> select to_char(floor(3.8166666667*1000)/1000,'99D999') from dual;
TO_CHAR
  3.816

Similar Messages

  • Get number after decimal

    Dear all,
    i have a question i have a program working with decimal numbers like 2.30 at some point in my code i have to know what is behind the decimal and put this in a int.
    So i have to know how to get a int with the value 30 out of the double with the value of 2.30
    There are solution of putting it to a string tokenize this and put the result in a int but there must be ways this can be done in a more basic way.
    somebody?
    regards,
    johan Louwers

    An fairly easy way to do it:
    ( value * 100 ) % 100
    Gives us the rest, which since we multiplied it with 100 should give you the two decimal value points as a integer.
    I will not delve deeper into the reason why or the worries of losing precision. I just give you the simple solution of accomplishing what you want. :)
    Regards,
    Peter Norell

  • Format-number,decimal not giving desired output for PO Print report XSL-FO

    Hi All,
    My requirement was to get the Unit price in european format which is 10.000,00
    Iam getting it as 10000,00 but the client needs the thousand's seperator.
    if have used the decimal seperator but iam getting the Unit Price value as 'NAN' when i submit it for an international language like Italian or Spanish
    This is what i have done
    set the decimal format
    <xsl:decimal-format name="euro" decimal-separator="," grouping-separator="."/>
    <xsl:value-of select="format-number(UNIT_PRICE, '#.###,####', 'euro')"/>
    This gives the desired output when i select the US language.
    While submitting through the conc request
    If i change the Numeric char to '.,' by clickin on Language settings..It works great
    I have tried to use the replace function but the syntax is not correct
    format-number(replace('UNIT_PRICE',',','.'), '#.###.###.###,####', 'euro')
    Any Help would be greatly appreciated.
    Thanks
    Mirza

    Hi Mirza,
    I'm struggling having the same problem. Have you found any solution?
    Best regards
    Kenneth

  • Change number of decimal in general settings after working .

    Hi,
    My customer was upgarded to sap2007 and changed the number of decimal in the "Amount" field to 4 ( it used to be 2)
    now after working a while he needs to change it back.
    Do you know what are the consequences of updating this field using an update query?
    thanks.

    Disaster - first SAP does not permit direct updates to the database it is a violation of agreement with both customers and partners.
    Second - even if you were to update the field your reports, fiancials, etc would never match due to rounding and display differences.
    I am guessing that the client does not like the 4 decimals on the forms and if this is the case they could be changed to display a rounded field by creating a new field, linking to the old field and using a formulae such as round(field_123,2). You would then die the old field.
    It is for this reason that SAP clearly warns you that setup of decimals are critical and cannot be changed after transactions are entered.

  • Altering number of decimal places of formatted number

    Using http://java.sun.com/docs/books/tutorial/i18n/format/numberFormat.html I have worked out how to format a number, almost. When I follow the example in this tutorial that shows how format a double, it always rounds it to 3 decimal places. How do I alter the number of decimal places that this formatting procedure outputs? I used the US as the locale and English as the language. I am assuming that if these parameters are chosen, 3 decimal places is the output. Is this assumption correct?

    Look at the next chapter :)
    http://java.sun.com/docs/books/tutorial/i18n/format/decimalFormat.html

  • Make one number after the decimal point

    hi all
    i have a column named quantity from the table job_done
    with values
    1900.8988
    34.67
    0.6788
    236.67
    789999.67676868
    i require the values to be 1900.8
    34.6
    0.6
    236.6
    789999.6
    i just require one number after the decimal point,i know substr but i am confused as to how to achieve this output
    kindly guide
    thanking in advance

    http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions221.htm#SQLRF06150
    Regards
    Etbin
    Edited by: Etbin on 5.5.2013 14:33
    <tt>substr(quantity,1,instr(quantity,'.') + 1)</tt> if those are not numbers but all contain a decimal point
    Edited by: Etbin on 5.5.2013 14:40
    <tt>case instr(quantity,'.') when 0 then quantity else substr(quantity,1,instr(quantity,'.') + 1) end</tt> when there are no <tt>null</tt> values
    <tt>trunc(to_number(quantity),1)</tt> seems to be the safest if quantities are really <tt>to_char(some_number)</tt>

  • Probook 4515s invalid serial number after format.

    Hello from beautiful Greece.
    I have a probook and for many months it closed many times by it self. So i think that was fun problem. I decide to make a format and after that my pc doesnt open again. 
    I take a screen with invalid serial number at the left corner and after that nothing, blank screen. When i go to bios i see that there are no infos about hdd, cs, motherboard serial number etc, so i cant boot from usb. I also delete the recover section on my hdd and i cant run recovely.
    I reinstall the bios but nothing.  Any soloution?

    Hello dskal
    Thanks for posting on the HP Forums!
    I understand you are experiencing an issue with your notebook. However, since this is a commercial notebook, you should post your issue on the notebook board of the HP Enterprise Forums for a better answer.
    Have a wonderful day!
    Mario
    I worked on behalf of HP.

  • BEx Analyzer displays wrong number of decimal places after implementing BW patch

    Hey folks,
    we patched our BW 7.31 from PL10 to PL15 last weekend and now we got some issue with the number of decimal places shown in BEx Analyzer 7.x.
    One example for KF X
    Settings Info Object X
    Decimal Places:                         Not defined
    RSRT - Display X
    Shows 3 decimal places
    Query Designer Settings using KF X
    Number of Descimal Places:     0  [Use Default Settings: NO]
    BEx Analyzer Properties for KF X
    Decimal Places:                         0
    Resulting in BEx Analyzer workbook shows 3 decimal places instead of 0!
    Anyone with an good idea about that?
    Thanks,
    Andreas

    Hi Andreas,
    Have you used the list calulation like "Calculate Result As Average" or "Calculate Single Values as normalization of result" in the relevant key figures?
    For "Calculate Single Values as normalization of result",iIt is the known design that it is always displayed with three decimal places for normalized values, and the setting in Query Designer for
    decimal place doesn't take effect.
    For "Calculate Result As Average", the following note maybe relevant.
    2096911 - Decimal places in query result is wrong, if average is used and display precision is set to less than 3, it will always show 3 decimal places.
    Another clue is to check if the key figure is a Quantity type with unit, and what's defined in table
    T006 field ANDEC for this unit.
    Hope this helpful.
    Regards,
    Ceciclia

  • Problem in Formatting Number in eTEXT template

    Hi All
    We want to format the payment amount for check in the eTEXT template.
    We want a number with 2 digits after decimal point and a comma before 3 digits to the decimal point.
    We tried using
    Number, ####,###.##
    But for the data 135 it is printing 0000135.00, But we want it in 135.00
    Similary for data 1356.7, we would like to have 1,356.70
    I tried with some trial and errors, but no luck.
    your help is appreciated.
    Thanks & Regards
    Naga

    it should work,
    I would like to see your template,
    drop me xml and template to my id , its in profile.

  • Format-number not working for me with preview to excel

    Hi,
    I have a report with 8 fields across within a table.
    Each field is formatted in the same way, with format-number like this (there are 8):
    <?format-number:total-year-remaining;’PT999G999D99’?>
    (that's the type-your-own form-field help text in the word template).
    When I preview the PDF, the data looks fine (8 cells shown below):
    .00 (.10) (.10) .00 (.50) (.50) (.60) (.60)
    But when previewing to Excel, there are two problems:
    1. Only the data in the last field (the 8th one) is formatted with the oracle mask:
    (.60)
    But upon closer inspection, there are two blank spaces after the number in that cell, and the value itself is treated like a string, e.g. '(.60) '. In fact if I ask excel to format this cell like a number with currency and two decimal places, in won't do it because of trailing spaces. Its just not a number to excel at that point. Probably the ('s don't help things either.
    2. The data in the first seven fields in excel are numeric, and I can format them in excel as currency, but I wanted XMLP to handle this, not the excel user.
    The bottom line is this: I want both PDF and excel output. I want both forms to have the fomat mask applied correctly. And I want excel to treat each cell as a number. Is this possible?
    Thanks
    Adam

    Anatoli,
    Hello!
    I don't know if my situation is the same as yours, but after a lot of head-scratching, forum searching and template rebuilding, I finally figured out my problem.
    I had one column that no matter what I did kept appearing in Excel as text. I'd format it to Number in Excel and nothing. When trying to sum the column, Excel would not recognize any of the values as numbers. I even did the reformatting on the XML Word template to number, and the currency format that Adam mentions. Still no go. The $ and ',' appeared, but column still formatted as string.
    I just finally noticed Adam's mention of the 2 extra spaces at the end of the numbers and sure enough mine was doing the same thing. Take out the 2 spaces and voila! Number!
    Every time I redid my template in Word (07 and 03), I used the wizard. (Add-ins>Insert>Table>Wizard) walked through the steps, not really changing anything. Then I would preview and the spaces would be there. The column that I was having problems with was the last column of the table, which would get the text 'end G_ASSIGNED_CC' inserted in after the field name - separated by 2 spaces. Once I took out these two spaces, so the column now shows 'COSTend G_ASSIGNED_CC', it worked fine in Excel - all numbers.
    Hope that helps someone out there as I was having a heck of a time finding anything (solutions anyway) on this.
    Thanks,
    Janel

  • Remove 0's after decimal.

    Hi,
    I have column value which returns values something like  123456.78 . This is sales information. I want the value to be returned something like this.
    "123,456". No 0's after decimal. The datatype for field stored in DB is Money.
    Can you any one help me here?
    Thanks
    Vikram

    Usually you want to truncate the cents on the presentation at the report level, but not on the query of the data. Consider if you want to add up the values on the report. $5.40 and $3.40 should total to $8.80, which you might display as $9. If you remove
    the cents on SQL Server and send the report $5 and $3, you would get a sum of $8, which isn't correct. So it's better to use Visakh16's solution of formatting the number in SSRS, and not in the SQL Server Database Engine. Then the sales numbers are changed,
    just formatted without cents.
    Rick Byham, Microsoft, SQL Server Books Online, Implies no warranty

  • Double with only 2 number after point

    hi,
    I have a double with a few number after the poin, I need have only 2 number after the point...
    in past I have asked in this forum and receive a good answer...
    NumberFormat formatter = new DecimalFormat("00.00");
    String Average=formatter.format(Media1);
    Now the problem is that Average is a String while I need a double, exists a way to return a double rather than a String...
    thanks in advance...

    hi,
    I have a double with a few number after the poin, I
    need have only 2 number after the point...
    in past I have asked in this forum and receive a good
    answer...
    NumberFormat formatter = new DecimalFormat("00.00");
    String Average=formatter.format(Media1);
    Now the problem is that Average is a String while I
    need a double, exists a way to return a double rather
    than a String...
    thanks in advance...You are confusing a double's value with its representation. The representation (as a string of characters - digits, decimal point, and more digits) is what shows 2 decimal places. That is what DecimalFormat is for.

  • Format to 2 decimal places?

    Hi, i need to display my data in 2 decimal places but now i'm getting results after some calculation (for eg. 2.336224). How can i round it off to 2.34?

    I also agree with Arun and Rajesh,
    When I need to specify the number of decimal points as part of an expression, e.g. ; - Tooltip series properties of a chart.
    I use; -
    =ROUND(Fields!Total.Value,2)
    or
    =FORMAT(Fields!Total.Value,"N")
    I hope this helps someone.
    If you have found any of my posts helpful then please vote them as helpful. Kieran Patrick Wood MCTS BI,MCC, PGD SoftDev (Open), MBCS http://www.innovativebusinessintelligence.com/ http://uk.linkedin.com/in/kieranpatrickwood

  • Can not change the number of decimal places in the normalization of result

    dear all
        i want to see the proportion of some data, for example, the income of May is 300, and the total income is 1000, i need to display it like 33.33% . so i set the
    Calculate single values as normalization of result, and then it display 33.333%, i like to display only two number of decimal places, so i set the number of decimal places as 0.00, but i doesn't work, it still display three decimal numbers.
        maybe you say i can use the percentage function like %CT %GT %RT, but i need to allow external access to my query, so the i can not use those functions.
        can somebody helps me ? your advice is appreciated.

    hi,thanks for your advice, but that doesn't suit for my problem.
    before i set the normalization of result, i can change the decimal values. After that i cann't.
    In your thread, someone proposes use the T-code OY04. but this wouldn't help. As i change to other key figure, such as user quantity, when i set normalization of result, it still display 3 decimal values.
    i think the point maybe lie in the normalization of result. please advise... thanks...

  • Format-number doesn't work with XSL and DW preview

    Hi All
    I'm creating XSL files to transform XML into HTML. However,
    the number formatting doesn;t seem to work in Dreamweaver. For
    example, if I specifiy:
    format-number(price,'$###,###.00'), I should get $7596.99. I
    actually get 7596.990000000001 in my Preview (no currency symbol,
    too many decimal places). If I do the same thing in another XSL
    editor (Xseleerator) I get: $7,596.99.
    This is REAL PAIN, as every time I do anything with number
    formatting, I need to open the XML and XSL in another product just
    to check the formattng.
    Can anyone shed any light on this?
    Thnaks
    Mark

    Try to declare the variable out side of the region
    <script> var tp1;</script>
    <div spry region ... >
    tab panel stuff
    <script type="text/javascript">
    tp1 = new Spry.Widget.TabbedPanels("tp1");
    </script>
    </div>

Maybe you are looking for