Rounding to a Desired Number of Significant Figures

I have a set of calculated results that I need to round to two significant figures.  The rounding rules that I need to use are 5 and above rounds up and below 5 rounds down (I'm not taking into consideration whether or not the number before the 5 is odd or even).  For example, I would need to round 0.04255 to 0.043 and 0.0255813953 to 0.026 etc.  What is the best way to do this?

I see it more like: (Significant figures - Wikipedia, the free encyclopedia)
with
nums as
(select dbms_random.value(1,10) * power(10,dbms_random.value(-3,3)) n
   from dual
connect by level <= 20
select n,to_number(to_char(n,'9.9EEEE')) two_sf
  from nums
N
TWO_SF
.1077173774258338170235954132298430158
.11
8.53962771187634184076369984400795578324
8.5
.022194820889696427358288675717763445656
.022
4.76262569327700302708295638036845816105
4.8
3.43343151110840952925833441847618384521
3.4
.011050298181252026432486073787207501344
.011
1.05884415230803488802221342198646306532
1.1
3.08619868068015260196327218960746037759
3.1
127.338206691206921082742082774157923779
130
62.7437377016055722022948632262851053876
63
4467.85370308854835976491726818452213797
4500
.093808998630023941227511219104505127839
.094
27.4073431755099062757919616516549440289
27
167.067765582500874637656618415509558873
170
55.828010718142781712579586239160087148
56
672.679541910114142076738291610977895052
670
.841422486489167075107155761553287521158
.84
445.568345138976965886465702688656719617
450
1.93038983554040004349873070460225178164
1.9
.018499393781581719222937784325059743601
.018
Regards
Etbin

Similar Messages

  • Rounding After a Certain Number of Characters

    Hi,
    I'm looking for a way to round a number off after a certain number of characters. I'm not looking to round a number off after, say, the third or fourth decimal place, but after the third or fourth number. For example, If I round off after 3 characters, then:
    19235.6578 goes to 19200
    1.95723 goes to 1.96
    How would I go about doing this? Any help is much appreciated.
    Thanks,
    JOD8FY

    Thanks for your reply. What I'm really trying to do is round off an answer to the correct number of significant figures. According to the rules for multiplying significant figures, the answer will have the same number of sig figs as the number in the operation with the least number of sig figs. To do this, what I thought I would do is find the length() of the least precise number in the operation and then round off the answer after that many characters. So, if the least precise number has four sig figs, the answer will get rounded off after the fourth number. Hope this makes what I want to do a little clearer; sorry for being vague.
    JOD8FY

  • Ni scope read vi significant figures

    Hello everyone,
    Let me start by giving you some background.
    I'm trying to measure a RMS voltage (around 1.8V) using the NI-Scope Read Measurement Vi, which works fine, my problem is that I'm also trying to calculate the RMS current within the same Vi, using a known resistance. Problem is with the voltage I only get two significant figures using the NI-Scope Read, which gives me to much of a rounding error when it comes to the current.
    So my question is this; is there another stock Vi that I could use to increase the number of significant figures I get or is there a way with this Vi to increase the number of significant figures? Any other ideas are welcome, and thanks so much for your help.
    Solved!
    Go to Solution.

    (Found out the conversation continued while I was typing, just back from lunch)
    The "niScope Read Measurement" VI is actually giving you a double-precision answer, which is a lot more than 2 sig. figs (15, I think, could be off a couple).
    Look at your front panel, do not start your program.
    Move the cursor over one of your RMS reading numbers.
    Click your right mouse button.
    Go down the menu to "Display Format" (or "Properties", makes no difference, you then just click on Properties tab).
    Read: "Digits [2] Precision Type [Digits of Precision]".
    Fix.
    Cameron
    One bit of unsolicited advice.
    Since it looks like you may not have tried much LabVIEW programming since you were last here asking basic questions like this one a bit over a year ago, please take some time to go through the online LabVIEW tutorials
    LabVIEW Introduction Course - Three Hours
    LabVIEW Introduction Course - Six Hours
    To err is human, but to really foul it up requires a computer.
    The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
    Profanity is the one language all programmers know best.
    An expert is someone who has made all the possible mistakes.
    To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):
    LabVIEW Unit 1 - Getting Started
    Learn to Use LabVIEW with MyDAQ

  • Significant Figures

    I can easily find several options relating to the number of decimal places shown for a number in Numbers, but I can't find any way of setting a specific number of significant figures instead - something which is often more useful if your values are over a wide range. Is there any way of doing this?

    septimus ii wrote:
    While I appreciate (and am rather impressed by) the ingenuity of the solutions posted here, it's not quite what I originally meant.
    I learnt that there are two ways of rounding numbers - to a specific number of decimal places or a specific number of significant figures. While the former is easy to adjust in the inspector and other places, I can't find any easy ways of displaying the latter. I'm not sure if this is a small gap in the program, or merely an option which I have missed.
    It's a "small gap in the program," for which the responders have attempted (successfully, I think) to provide some chinking.
    It also looks like an opportunity to Provide Numbers Feedback making a feature enhancement request for future editions of Numbers. Use the item of that name in the Numbers menu, or the link in the previous sentence.
    Regards,
    Barry

  • How do I change the number of significant digits in a slide's digital display?

    I suspect I'm missing something really obvious. I want the slide's digital display to show 1.23 instead of 1.23456. Here's what I tried:
    1. Drop a Horizontal Pointer Slide
    2. Make its Digital Display visible
    3. Type 1.23456 into that display
    4. Pop up on the Digital Display and select "Display Format..."
    5. Change the number of significant digits to 3 and hit "OK"
    The digital display still shows 1.23456. What am I missing?
    Solved!
    Go to Solution.

    LOL - I had the same problem.  Hidden in plain sight!  All I saw was Numeric, and thought "Duh! Of course it's numeric - it's a slider!"
    I do think NI could do a much better job on this, perhaps with more informative labelling.  Slider Scaling or Scale Format might be better.  Also, since one can select the Digital Display by itself on the front panel, one should be taken directly to the digital display formatting when Properties is selected, instead of still having to change the dropdown. By selecting the digital display instaead of the slider, you're implying that you want to change its format only.

  • Experience with creation of a large number of key figures

    Hi:
    I have a need to create a large number of Key Figures (at least about 50 of them) for DP use. Do you have any experience with automating this task if so, can you share your experience?  Thanks.
    Satish

    Hi,
    So far we have not come across a need to automate KF creation. And 50 KF is not a huge number, it would take may be a couple of hours to create them. Also, since it is a one time activity, developing an automation script for the same does not sound useful. You might want to consider creating them manually so that you can ensure all settings are proper.
    Hope this helps.
    Thanks & Regards
    Mani Suresh

  • Purchase Order value rounded to a single number

    How is the Purchase Order value rounded to a single number ?
    Ex: Example - 100.51 to be rounded to 101 OR
    100.49 to be rounded to 100 
    It is required at PO - Price conditions . (Item details----material net price )
    (and also in PO output screen which can be done with the help of developer)
    regards,
    ck

    Hi,
    Go to
    SPRO - > MM -> Purchasing -> Define price detmination process -> define condition types -> go for define condition type ->  select any condition type -> go to details -> inside it you will see the Rounding rule -> choose 'A'
    Save your enteries...and check..
    Hope it helps..
    Regards,
    Priyanka.P
    AWARD IF HELPFULL

  • Max number of key figures

    In BI 2004s 7.0, how many key figures or the maximum number of key figures can a query have in the Column area that would not impede the performance of running the query? This would include key figures that use User Exit code for variables, RKFs, and CKFs.

    I can't imagine a requirement that would have 175 key figures in a query. What would be the requirement?
    It would be a big burden to maintain, support it, and change control. One of the tips to improving query performance is to break up the query with this number of key figures into smaller queries and make use of RRI. Workbooks are there for use with multiple worksheets or 1 worksheet with multiple grids. How would you improve query performance with this kind of query.
    The key figures are created to be able to derive other key figures based on the RKFs that make use of the exit code that determines the dates from what the user enters. 
    Are you saying that a Business Analyst would use 175 key figures to do the analysis at a time? I have seen the most is 12 - 13 key figures that are not hidden and the 10 others are hidden because they are use for derivation - a total of 23 key figures in a query. 
    "Insecured people are full of themselves. Nobody wants to be a second hand smoker or a job from you. Move on and stop calling me"

  • Rounding to a whole number

    What is the proper syntax for rounding to a whole number.  In my spread sheet I have a function set up to apply a divisor to cost, in this case  = F7 $625 / G7 .65 = $961.54.  I simply want the number to round to the nearest whole dollar amount  $962.00

    Hi ghemmen,
    or you could just do with formatting.
    quinn

  • Yielding the desired number of decimal places using the AVG function in t-sql

    Hello again.  Confused retired hobby coder having trouble setting up a scalar-valued function to return the desired number of decimal places from a AVG query.
    Whenever I run the following script I get the number of decimals I desire:
    Using the above I created a scalar-valued function as follows:
    Running this function as: SELECT [dbo].[TestHCIPartial] (1,3)  my return is -7.
    Can you help me with the function causing it to yield the answer to 6 decimal places?
    Thanks and regards, Minuend.

    You've not specified precision and scale in UDF return type. So you're leaving it to server to interpret it based on default settings
    If you want exactly up to four decimal places tweak udf as below
    ALTER FUNCTION..
    RETURNS decimal(20,4)
    AS
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Round up a float number

    Hi!
    Which Math function do I have to use to round up a float number ? I thought the correct one was the Math.ceil() function but I don't get what I need. I mean, which is the correct function to get the following result:
    Math.function(2.75)=3
    Thanks

    This is what I get:
    Math.ceil(2.75)=2I get 3.0 for that calculation. You must be doing something besides the raw calculation. Here's my code that tests it:public static void main(String[] args) {
      System.out.println(Math.ceil(2.75));
    }Let's see yours.
    PC&#178;

  • Number of key Figures used in Query

    Hi,
    I would like to know the number of queries in a Query,
    Is there any way to find out this?
    We have nearly 100 queries, and we were asked to find out the top 5 queries in terms of number of key figures.
    Thx.

    Hi Thejo,
    There is no direct way to do this using another BW query simply because the data is not stored in either Masterdata Info Objects/CUBE ODS. They are stored in BW system tables which are not directly accesible by any queries to build using the Query Builder.
    Try to locate the system table that holds these Info (Keyfigures + Query Name) and do ABAP Query instead.
    Regards,
    Jkyle

  • I am having to restart my iphone 4 prior to making a call otherwise my phone will not call the desired number, any solutions

    I am having to restart my iphone 4 on a regular basis prior to making a call otherwise my phone will not call the desired number, this is an intermittant fault any solutions.

    Hi toddea,
    If you are having issues backing up your iPhone to iTunes on your Windows machine, you may find the troubleshooting steps outlined in the following article helpful:
    iOS: If you can't back up or restore from a backup in iTunes
    http://support.apple.com/kb/ts2529
    Regards,
    - Brenden

  • Rounding off 2 decimal number

    Hi,
    How can i round up float number to two decimal number.
    For example
    Number is 45.987654532 then It should be rounded up to 45.98
    Number is 45.987654546 then It should be rounded up to 45.99Appriciated sample souuce (If any)
    Tanks in advance

    You could have a look at String's format() method. The format strings are
    described in detail here:
    http://java.sun.com/j2se/1.5.0/docs/api/java/util/Formatter.htmlpublic class Round {
        public static void main(String[] args) {
            double number = 45.987654546;
            String roundStr = String.format("%.2f", number);
                // Rounded is 45.99
            System.out.println("Rounded is " + roundStr);
                // The same thing
            System.out.printf("Rounded is %.2f%n",  number);
    }Note: these methods generate rounded Strings from floating
    point numbers. Also, they round to a string representing the "nearest"
    number - your first example is a little hard to understand in this regard.

  • Formula rounding to nearest whole number

    Hello,
    I have created the following formula ( Metrics."# of Leads Resulting in Won Opportunity"*100 /Metrics."# of Leads" ) and displayed the results in percentage but it looks to round to the nearest whole number does anyone know why this might happen. Also i am using 2dp in the results i am hoping to get the actual result rounded to 2dp and not the nearest whole number.

    Hi !
    I think that if you add the ROUND function, this will work... :
    ROUND(Metrics."# of Leads Resulting in Won Opportunity"*100 /Metrics."# of Leads", 2)
    Hope this will help, feel free to ask more !
    Max

Maybe you are looking for

  • How to deselect the column in a report

    While creating a report, i had selected the id which is a primary key column, now can i deselect that? is it possible? Whne i update something, record is getting created twice. Regards, Pallavi

  • There is a mismatch between order type and GL accountu201D.

    Hello Can any one help me to know why I am getting this error message. Here  I am giving the steps carried out. Step1. Using transaction code: FB60 I have posted a vendor invoice to a Machinery account GL account against a internal order. Step2. A do

  • Inserting row in the result set

    Hi need to insert a row in resultset when previous row typ=c and next row typ=p then need to insert one row in between typ c and p with typ =s see the #temp_result table for result expected --drop table temp1 --drop table temp1_result --presently dat

  • How to set Value from Frame to Frame

    I am having 2 Frame. Frame A and Frame B. Frame A is having a text Field and a button. When i click on the button on the Frame A, how can pass the value inside the text field of Frame A into a text Field of Frame B which already prepared. Please help

  • How to include unicode chars in text boxes?

    Hi, We need the unicode chars (for example: Chinese, Korean, etc...) to appear in the generated .pdf and .pcl files from the Adobe Output designer's IFD file. These chars are static and will not change, so we shall not be fetching them from FNF file