trunc percentage two decimal places

I have a report that offers the option of dispalying pdf or excel. I have the pdf version works fine, but I'm having a little trouble on the version of excel. I have a grand total and the total for the Department. Basically, I need help formatting two decimal places. The dept_total and the grand_total are numbers that both display. I have another column that indicates what percentage of the total is in every Department it currently returns a number such as 10.23383547957459973, I need to display in the form of 10.23, how can I integrate the trunc function in this code?

(...to_char((dept_total/Grand_Total) * 100)

The query looks like this.
Select
TO_CHAR (a._grand_total)
to_char (a.dept_total)
TO_CHAR ((dept_total/grand_total) * 100)
de)
Select sum (xxxx) grand_total,
Sum (xxxx) dept_total
According to the table) one

TO_CHAR (trunc ((dept_total/Grand_Total) * 100.2))

Or, if you want to round to two decimals palces:

TO_CHAR (Round ((dept_total/Grand_Total) * 100.2))

SY.

Tags: Database

Similar Questions

  • Tour of metric to two decimal places by using [math]: tour

    I use the following psobject to extract performance data, but I have around two of the measures with two decimal places. Usually, I would use [math]: round ($var, 2) but I do not know how to integrate this into the code and settings, I need are AvgMem and AvgCPU.

    $groups | % {

    New-object PSObject-property @ {}

    'TimeIndex' = $_. Group [0]. TimeStamp

    "AvgMem" = $_. Group | where {$_.} MetricId - eq "mem.usage.average"} | Measure-object-property value - average | Select - ExpandProperty average

    "AvgCPU" = $_. Group | where {$_.} MetricId - eq "cpu.usage.average"} | Measure-object-property value - average | Select - ExpandProperty average

    'TotalMemory' = $TotalMemory.Split(".") | Select - index 0

    'TotalCPU' = ((Get-cluster_$cluster_|_get-vmhost_|_%_{$_}_|_measure-object-property_cputotalmhz-sum).sum)

    "Cluster" = $cluster

    'Data center' = $DC

    "vCenter' = $vcenter
    "Home" = $VMSummary.Hostname

    }

    }

    Any help is appreciated

    Thanks in advance

    Do you have one loan try like this

    $groups | % {

    New-object PSObject-property @ {}

    'TimeIndex' = $_. Group [0]. TimeStamp

    "AvgMem" = [math]: Round (($_.)) Group | where {$_.} MetricId - eq "mem.usage.average"} | Measure-object-property value - average | Select average - ExpandProperty), 2)

    "AvgCPU" = [math]: Round (($_.)) Group | where {$_.} MetricId - eq "cpu.usage.average"} | Measure-object-property value - average | Select average - ExpandProperty), 2)

    'TotalMemory' = $TotalMemory.Split(".") | Select - index 0

    'TotalCPU' = ((Get-cluster_$cluster_|_get-vmhost_|_%_{$_}_|_measure-object-property_cputotalmhz-sum).sum)

    "Cluster" = $cluster

    'Data center' = $DC

    "vCenter' = $vcenter

    "Home" = $VMSummary.Hostname

    }

    }

  • Limitation of DISTANCE to two decimal places

    I pretty much get the Google Maps API, talking to my SQL database. For the results of my research, I have SQL code:

    SELECT *, (3959 * acos (cos (radians (".")))) $POST ["latitude"]. (radians (lat)))) * cos * cos ((LNG) radians: radians (".")) $POST ["longitude"]. ")) + sin (radians (". "))" $_POST ["latitude"]. ")) * sin (radians (lat))) AS distance FROM VenuesGeocodes1 HAVING distance < 100 ORDER BY LIMIT 0, 30;"

    That works very well, but will display the distance to 15 decimal places, which is an exaggeration full.

    How can I limit that to only two decimal places? I thought I just needed to change the distance to distance (10.2), but he doesn't like it.

    If anyone can let me know what need would be much appreciated.

    Thank you.

    If you use PHP, you can do it like this:

    $grandtotal = number_format($grandtotal,2,'.',',');

  • How to tour calculations with two decimal places (scaling of the form)

    Hello

    I created an order form where customers enter the amount of product that they want to order and the form shows the total amount payable (including transport and sales tax). According to the user input, the amount total resulting sometimes contains more than two decimal places. How do I turn calculations to two decimal places? Is it possible to do this form on the scale?

    I'm new to using Acrobat for calculations. Any help would be greatly appreciated! Thank you...

    This should be:

    Event.Value = util.printf ("%.2f", event.value);

  • rounded to two decimal places

    my cost per month textbox typically returns several decimal places, is it possible to limit it's out to two decimal places as actual monetary calculations?

    calculatebutton.addEventListener (MouseEvent.CLICK, doMyCalculation);

    calculatebutton2.addEventListener (MouseEvent.CLICK, doMyCalculation2);

    costpermonth. Restrict = '. 0-9 ";

    {

    var strFileName: number;

    strFileName = Number (costofitem.text) - (amountsaved.text) Number;

    amountneedtosave. Text = String (myAnswer);

    }

    function doMyCalculation2(e:MouseEvent):void

    {

    var myAnswer2: number;

    myAnswer2 = Number (amountneedtosave.text) / Number (howmanymonths.text).

    costpermonth. Text = String (myAnswer2);

    }

    Use the numbers toFixed() method:

    amountneedtosave. Text = myAnswer.toFixed (2);
  • Format of number to two decimal places

    Hi all

    I tried to find a similar question on OTN position but were not very successful. Found [this: http://forums.oracle.com/forums/thread.jspa?messageID=4231352 & #4231352], but this isn't the right solution for me.

    I want to convert a number (to two decimal places) to a string, but keep the trailing zeros. The number can be of any length.

    So, for example

    Number String          
    1234.5 1234.50
    323213.1 323213.10
    9876.23 9876.23

    Using a mask of format with to_char function does not work for me because the results are recorded in a text using UTL_FILE file and I don't want any white space.

    For example

    Select to_char (1234.40, '9999999.99') of double
    TO_CHAR (1232.70,99999999.99)
    ----------------------------
    1232.70

    As you can see the to_char doesn't work only partially. It keeps the two decimals and add a zero, but it also hads of white space at the front of the number. I could change the format mask to "9999.99', but then if the number is 12345.12 or 123.12 it wouldn't work!

    Thank you!

    Use the format fm modifier:

    Select to_char(1234.40, 'fm9999999.90') from dual;
    
    TO_CHAR(1234.40,'FM9999999.90')
    -------------------------------
    1234.40   
    
  • Round a number to two decimal places.


    Do you know how to round a number to an integer? If so, multiply your number of targets per 100, round down to an integer, and then divide the result by 100.

  • How to leave only two decimal places in UsedSpaceGB value

    Hello

    I have the following statement:

    Get - vm server * | SELECT name, UsedSpaceGB, VMhost, comments | FT-auto

    but the usedspace Go is like this 104.06407394539564847946166992

    How can I put it in 104,06?

    With the Round function

    get-vm server* |
    select name,@{N="UsedSpaceGB";E={[math]::Round($_.UsedSpaceGB,2)}},VMhost,guest | ft -auto
    
  • I have a basic calculation, but I can't figure out how to make the total tower with two decimal places

    Here is the code I use. I looked everywhere, but I couldn't find answers on how to round specific numbers, not total String.

    Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;

    gccalculate.addEventListener (TouchEvent.TOUCH_TAP, fl_TapHandler_21);

    function fl_TapHandler_21(event:TouchEvent):void

    {

    var a: number = Number (input1.text) * Number (input2.text) *.01 * Number (input3.text).

    total.set_Text = String (a);

    }

    use toFixed():

    Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;

    gccalculate.addEventListener (TouchEvent.TOUCH_TAP, fl_TapHandler_21);

    function fl_TapHandler_21(event:TouchEvent):void

    {

    var a: number = Number (input1.text) * Number (input2.text) *.01 * Number (input3.text).

    total.set_Text = a.toFixed (2);

    }

  • How to make the calculation script to show 2 decimal places and stop rounding down to integers?

    Hello. First of all, thank you to those of you who have helped me create an interactive PDF file last year that worked perfectly if only integers are entered. This year, my client wants to show two decimal places in the calculations, and I'm back in this forum hoping to find the same expertise to make it happen.

    My form includes 43 fields for various monthly expenses. The sign of dollar for each field is part of the content of the form, not part of the scope of formatting. Users enter values directly in these fields, and the fields are formatted to display two decimal places. Each of these includes a the following validation script:

    Event.RC =! (event.value & & + event.value < 0);


    To the right of each of these fees, the fields are yes/no boxes ( expense Typecalled) that answer the question, "is this essential expense? The value of exports for Yes's 'essential', and the value of exports is "discretionary".


    A value entered in all areas of expenditure is directed to the field Total expenses by checking Yes or field Total discretionary spending by clicking No. two of these total fields are formatted to display two decimal places. In addition to long calculation scripts, the two totals fields include this custom validation script:

    If (event.value == "0") {event.value = util.printx ("", event.value)}

    Here's the problem: when values with two decimal places are entered in any area of expenditure, the calculation in two fields of total script rounded to the whole number closest. When 10.99 is entered in a field of expenditure and the Yes checkbox is checked, the value 10.00 is displayed in the field Total expenses . I want to display 10.99.

    For testing purposes, I inserted a new text field and did a simple calculation in choosing the fields of the somme and the values displayed correctly. The problem is definitely with the script in the two fields in total .


    I can drop the scripts of math here, but they are long and I'm not sure what the Protocol is super-long positions. I could also download the file, but I never did it and will need to understand this.

    Thank you for taking the time to read this. If you can help me, very well!

    To explicitly convert the field values for numbers, do something like this instead:

    var expense0 = + getField('monthly$.0').value,

    depenses1 = + getField('monthly$.1').value,

    etc.

  • Deliver the result rounded to 2 decimal places.

    Good day to all,

    I currently have a script format in order to get the average of 10 fields in my form that also ignores the empty fields. Here is my current script:

    Initialize variables

    var num = 0;

    var sum = 0;

    Check input fields

    for (var i = 1; i < 10; i ++) {}

    var f = getField ("Assesment_Rating" + i);

    If {(f.valueAsString)

    increment the counter to non-empty field

    NUM ++;

    Add the value of the running total field

    sum += + f.value;

    }

    }

    Calculate the average

    If {(num)

    Event.Value = sum / num;

    } else {}

    If the fields are empty, so put to white

    Event.Value = "";

    }

    He is currently working if I have a total of 1.4444444444444, this is what is displayed. I tried a few functions of Math.Round who give me "1.5" as a result that is not correct. I'm still learning so I could try a Math.Round function in the bad part of my code, but can not get the result I need.

    Thank you in advance for your help!

    This script should be a personalized calculation script that sets the value of the field. You can then set the type of number format and two decimal places.

  • OBI, rounded to 2 decimal places

    I just created a simple application with a dumy column and a single column and gave the math in this column as 23/12, 6. The returned result is 1.83. Why the result is rounded to two decimal places?

    THX.

    Hi parag.

    OBIEE inwardly rounded to 2 decimal places... for the calculation you mentioned 23/12.6 gives you great something like 16-digit number after the decimal point.

    If you want to check with Select 23/12.6 double (GOLD)
    If you want to round your favorite decimal check with this query, select double round(23/12.6,5)

    Hope this helps you.

    By,.
    KK

    Published by: KK on October 21, 2010 23:15

  • Decimal places missing in Pivot using the rule of aggregation 'average '.

    Hi, I have a PivotTable that has three layers. The first two are made and displayed in the form of values, and the last of them uses the average of the aggregation rule to create an average of the first two. Thus, for example, I have a month a closed case counts, then a count of the number of days to close the cases, and then I want the average number of days to end. The problem is that days on average close appears always to round down - even if I'm showing two decimal places.

    Closed the case = 103
    Closing days = 1599
    Closing days on average = 15.52 (calculated) but the poster 15.0 pivot

    Any ideas on how to solve this problem would be appreciated.

    Thank you
    Larry

    OBIEE is actuelly the correct calculation of handling. If you divede two whole mathematical standards you can not get a fraction. To work around this, you must first convert duplicate ==> CAST ("days to close" DOUBLE) / CAST ("closed cases" as DOUBLE)

    Concerning

    John
    http://www.obiee101.blogspot.com/

  • Number of decimal places in the recorded data

    Hello world

    I use the writing on measurement file Express VI and everything works well except for one thing. I have too many decimal places in my saved data. I really need 2 decimal places for my application. Is there a way I can fix this without having to open the file with Excel and format numbers?

    Just FYI I'm writing dynamic data, the VI write is configured for text (.lvm) file format, and it is delimited by tabs.

    Joint are two images: one of the worksheet of stored data, and the other is my writing to measure Express VI.

    Thank you!

    Laura

    Not with the express vi

    You CAN specify a format "%.2f" write to the spreadsheet file

  • How to truncate my query results in a column to reflect only 2 decimal places

    SELECT (COLUMNNAME/60) / 60 AS ACTHOURS
    FROM TABLENAME

    This request is currently converting seconds to hours, but some values are endless beyond the comma. I want only the results to show 2 decimal places.

    Can anyone suggest how to proceed?
    SELECT round((COLUMNNAME/60)/60,2) AS ACTHOURS_ROUND,
           trunc((COLUMNNAME/60)/60,2) AS ACTHOURS_CUT
    FROM TABLENAME;
    

    You can find the documentation here:

    http://docs.Oracle.com/CD/E11882_01/server.112/e10592/functions155.htm#i78633

    http://docs.Oracle.com/CD/E11882_01/server.112/e10592/functions221.htm#i79729

    Published by: hm on 26.04.2012 05:20

Maybe you are looking for

  • order of playlist file

    I have a problem with the order of my folders in playlist in iTunes. Currently, they are in alphabetical order, each containing several playlists. But after selecting a playlist folder, it passes immediately to the foot of the playlist files, so out

  • backup iPad to find to iCloud

    I have an ipad 2.  When I check itunes, I see that a backup has just been made in icloud.  However, when I check icloud, I don't see any file called "backup of the ipad.  So, where is this icloud ipad backup?  My software is up to date on my Mac with

  • Spectrum x 360: turn off permanent lighting under the F5 on spectrum x 360

    Is there a way to disable the backlight persisting under the F5 on the HP laptop, spectrum x 360?  TO CLARIFY, I'M NOT HOW TO DISABLE THE FUNCTIONALITY OF THE RO KEY ANY FUNCTION KEY F5.  I just want to know how to DISABLE light PERMANENT under the F

  • Acer Iconia A3 - A10: is it possible to downgrade to Android Jelly Bean?

    Hello I upgraded my Acer Iconia A3 - A10 of Jelly Bean to Kitkat a few days ago. Not happy at all. Many applications running too slow, wifi doesn't work well, etc. I did a factory data reset but my Tablet Android 4.4.2 lights. Is this normal? Is it p

  • HP 7525: Do not print

    My printer shows the two black inks are full, as are the colors. When I try to print the page comes out blank. Why? I just installed new black HP ink photo and print.